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

Default to stricter warning flags in CMakeLists.txt and all.sh #9317

Open
gilles-peskine-arm opened this issue Jun 27, 2024 · 0 comments
Open
Labels
component-test Test framework and CI scripts enhancement

Comments

@gilles-peskine-arm
Copy link
Contributor

gilles-peskine-arm commented Jun 27, 2024

In all.sh, we do most builds with gcc -Wall -Wextra or clang -Wall -Wextra, sometimes a few more flags from CMakeLists.txt when doing a CMake build (depending on the build type — IIRC Check is stricter than Asan). We should enable more flags, to catch buggy or non-portable code. In particular:

  • -std=c99 -pedantic
  • -Wwrite-strings
  • -Wlogical-op
  • -Wshadow
  • -Wformat-signedness -Wformat-overflow=2 -Wformat-truncation, maybe other printf flags

This would haved allowed us to catch bugs such as #9311 (discussion).

We should also use newer compilers, but that's out of scope here.

@gilles-peskine-arm gilles-peskine-arm added enhancement component-test Test framework and CI scripts labels Jun 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component-test Test framework and CI scripts enhancement
Projects
Status: No status
Status: No status
Development

No branches or pull requests

1 participant