Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
I don't think /external:Wn behaves exactly like -Wsystem-headers. /external:Wn applies /Wn to the system headers, while -Wsystem-headers applies whatever is on the command line to the system headers. I think /external:Wn behaves more like:
// foo.c #pragma clang diagnostic push #pragma clang diagnostic warning "-Wall" #include <foo.h> #pragma clang diagnostic pop void foo() { int i = 10; }
// foo.h void bar() { int i = 11; }
Passing -Wno-unused-variables only suppresses the warnings for the rest of foo.c. It looks like the pragma is calling setSeverityForGroup(diag::Flavor::WarningOrError, "-Wall", diag::Serverity::Warning, Loc), but I'm not sure where we can detect that we are including a system header.
Right, this is not the same, but I suppose it's better than ignoring the flag.
clang/include/clang/Driver/Options.td | ||
---|---|---|
6480 | should we map it to -Wno-system-headers? | |
clang/test/Driver/cl-zc.cpp | ||
106 ↗ | (On Diff #435710) | This is not the right test file, cl-zc.cpp is for testing /Zc flags. |
lgtm
clang/include/clang/Driver/Options.td | ||
---|---|---|
6480 | For the help text, the "with -Wno-system-headers" part seems redundant. Ignore warnings from system headers (default) |
Hmm do you know how I can restart the pre-merge checks? It looks like the x64 debian openmp tests failed. I don't think this patch is related, but I want to make sure
You can rebase and upload the patch again. But those bots are pretty flaky, I don't think it's related to this patch either.
should we map it to -Wno-system-headers?