Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider enabling compiler warnings in add_avif_fuzztest() in tests/CMakeLists.txt #2350

Closed
wantehchang opened this issue Jul 31, 2024 · 3 comments · Fixed by #2356
Closed

Comments

@wantehchang
Copy link
Collaborator

@jzern @vrabaud @y-guyon

In #2344 I enabled compiler warnings in the tests/ directory, but I had to exclude the add_avif_fuzztest() macro because there are compiler warnings in the FuzzTest and Abseil headers.

It would be good to look into whether it is possible to enable compiler warnings in add_avif_fuzztest(), e.g., by turning off the warnings in the FuzzTest and Abseil headers.

I am surprised that Abseil headers have compiler warnings when compiled with -Wall -Wextra. The Abseil Compiler Flags page says they compile with -Wall -Wextra under GCC but turn off -Wsign-compare (which is one of the warnings I saw). So we can first suppress the compiler warnings in Abseil headers under the guidance of the Abseil Compiler Flags page, and then see what we need to do with the compiler warnings in FuzzTest headers.

@vrabaud
Copy link
Collaborator

vrabaud commented Jul 31, 2024

In CMake 3.25 and above, we can add the SYSTEM property to the add_subdirectory of the fuzztest folder. fuzztest only recommends to use an add_subdirectory but we could try to FetchContent it as imported targets are SYSTEM I believe.

@wantehchang
Copy link
Collaborator Author

We ignore the compiler warnings when FuzzTest itself is compiled. This issue is about the compiler warnings when our fuzztest source files are compiled (because they include FuzzTest headers).

@wantehchang
Copy link
Collaborator Author

wantehchang commented Aug 1, 2024

Vincent: I misunderstood your comment. Sorry. (I didn't know that compilers do not warn about issues in system headers.) I think adding the SYSTEM property to the add_subdirectory() call of the fuzztest folder is a good solution. Thanks for the suggestion. I am testing it in #2356.

wantehchang added a commit to wantehchang/libavif that referenced this issue Aug 1, 2024
Pass the SYSTEM argument to add_subdirectory(ext/fuzztest) to treat
FuzzTest headers as system headers. This suppresses compiler warnings in
FuzzTest headers.

Fix AOMediaCodec#2350.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants