Skip to content

build: Use curated clang -Wall instead of -Weverything for clang-cl#1554

Closed
jpnurmi wants to merge 1 commit intomasterfrom
jpnurmi/build/clangcl-wall
Closed

build: Use curated clang -Wall instead of -Weverything for clang-cl#1554
jpnurmi wants to merge 1 commit intomasterfrom
jpnurmi/build/clangcl-wall

Conversation

@jpnurmi
Copy link
Collaborator

@jpnurmi jpnurmi commented Mar 5, 2026

In clang-cl, bare -Wall maps to -Weverything, which enables all warnings including -Wswitch-enum. Use /clang:-Wall to get the standard curated clang -Wall subset instead, and remove the many -Wno-* suppressions that were only needed to tame -Weverything.

See also:

In clang-cl, bare `-Wall` maps to `-Weverything`, which enables all
warnings including `-Wswitch-enum`. Use `/clang:-Wall` to get the
standard curated clang `-Wall` subset instead, and remove the many
`-Wno-*` suppressions that were only needed to tame `-Weverything`.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@supervacuus
Copy link
Collaborator

supervacuus commented Mar 5, 2026

I actually appreciated the -Weverything feedback (even if unintentional) with explicit removal, because it forced us to fix a lot of buggy code since we introduced clang-cl. In particular, the trigger for this change being, -Wswitch-enum is a sensible warning, because it forces you to review all switch statements that switch on values of that enum when you introduce a new enum value, whereas default is a classic "covers-all" trap. I know it sounds pedantic, but I consider this quite valuable. I something is truly worthless, we can always deactivate it. The diff between -Weverything and -Wall is much bigger than the set of our counter flags.

@jpnurmi
Copy link
Collaborator Author

jpnurmi commented Mar 5, 2026

Ok, no problem. I thought it wasn't intentional. Perhaps we could then turn on -Weverything for one of the faster Linux builds, too?

@jpnurmi jpnurmi closed this Mar 5, 2026
@supervacuus
Copy link
Collaborator

Ok, no problem. I thought it wasn't intentional. Perhaps we could then turn on -Weverything for one of the faster Linux builds, too?

I mean, we can try to increase the warning level everywhere, but test this locally first because it always takes a little time to figure out what actually valuable feedback is and what is just noise.

Much more valuable would be to fix the CI configs where -Werror is currently turned off due to remaining warnings, though.

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 this pull request may close these issues.

2 participants