Conversation
I presume it was not detected before because "fileio.h" is probably always included after "util.h".
Cyan4973
added a commit
that referenced
this pull request
Aug 3, 2022
fileio_types.h cannot be parsed by itself because it relies on basic types defined in `lib/common/mem.h`. As for #3231, it likely wasn't detected because `mem.h` was probably included before within target files. But this is not proper. A "easy" solution would be to add the missing include, but each dependency should be considered "bad" by default, and only allowed if it brings some tangible value. In this case, since these types are only used to declare internal structure variables which are effectively only flags, I believe it's really not valuable to add a dependency on `mem.h` for this purpose while the standard `int` type can do the same job. I was expecting some compiler warnings following this change, but it turns out we don't use `-Wconversion` by default on `zstd` source code, so there is none. Nevertheless, I enabled `-Wconversion` locally and proceeded to fix a few conversion warnings in the process. Adding `-Wconversion` to the list of flags used for `zstd` is something I would be favorable over the long term, but it cannot be done overnight, because the nb of places where this warning is triggered is daunting. Better progressively reduce the nb of triggered `-Wconversion` warnings before enabling this flag by default.
felixhandte
approved these changes
Aug 3, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Surprisingly, the issue was not detected before
probably because
"fileio.h"is always included after"util.h".