[BUG] Ignored -Wno-error-dangling-reference in common.h should be -Werror-dangling-reference
wolfseifert opened this issue · comments
Describe the bug
The ignored "-Wno-error-dangling-reference" in common.h should be "-Werror-dangling-reference", otherwise it produces a warning by itself.
Additional context
See 9aefcee.
Thanks!
By the way, using -Wno-unknown-warning
might help handling these:
When an unrecognized warning option is requested (e.g., -Wunknown-warning), GCC emits a diagnostic stating that the option is not recognized. However, if the -Wno- form is used, the behavior is slightly different: no diagnostic is produced for -Wno-unknown-warning unless other diagnostics are being produced. This allows the use of new -Wno- options with old compilers, but if something goes wrong, the compiler warns that an unrecognized option is present.
and I believe Clang has a similar thing.
Thanks! Interesting... it looks like for a command line that works for both GCC and Clang I need to add -Wno-unknown-warning -Wno-unknown-warning-option
-- the first is GCC's spelling and seems to ignore only -Wno-xxx
negative flags, the second is Clang's spelling and seems to also ignore -Wxxx
flags, and using them both seems to work to make GCC and Clang ignore also each other's no-warning options (which is getting slightly meta).
Pushed: 5a032d7
And it passed 10/10, so looks good. Thanks again.