compilers: force clang to error on unknown warning options#15714
Open
tristan957 wants to merge 1 commit into
Open
compilers: force clang to error on unknown warning options#15714tristan957 wants to merge 1 commit into
tristan957 wants to merge 1 commit into
Conversation
gcc seems to error by default if an unknown warning option is passed to
it:
CC=gcc meson setup build -Dc_args=-Wbad
gcc will fail in the project() call during the sanity check. clang does
not currently doing that:
CC=clang meson setup build -Dc_args=-Wbad
...will continue until an actual compilation like cc.compiles()
from meson-log.txt...
Sanity check compile stderr:
warning: unknown warning option '-Wbad' [-Wunknown-warning-option]
We should error in the sanity check to notify the user as soon as
possible that they have errors in their environment.
Signed-off-by: Tristan Partin <tristan@partin.io>
d580eff to
e875e03
Compare
hlinnaka
reviewed
Apr 17, 2026
Comment on lines
+94
to
+95
| # Force clang to fail in sanity checks if an unknwon warning option is | ||
| # user |
There was a problem hiding this comment.
just some trivial typos:
Suggested change
| # Force clang to fail in sanity checks if an unknwon warning option is | |
| # user | |
| # Force clang to fail in sanity checks if an unknown warning option is | |
| # used |
Contributor
|
Also it's probably best to take the occasion and synchronize the handling of clang (which adds the arguments in |
Member
|
I agree with bonzini, using the sanity check args makes more sense. I'm also concerned putting it in always args is going to break builds of projects that blinding add arguments on "is linux" or "is clang" |
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.
gcc seems to error by default if an unknown warning option is passed to it:
gcc will fail in the project() call during the sanity check. clang does not currently doing that:
We should error in the sanity check to notify the user as soon as possible that they have errors in their environment.