This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/60097] spurious warning about command line option "-Wno-mismatched-tags"


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60097

Harald van Dijk <harald at gigawatt dot nl> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |harald at gigawatt dot nl

--- Comment #1 from Harald van Dijk <harald at gigawatt dot nl> ---
This is intentional. Messages for unrecognised -Wno-* options are only emitted
if there are warnings.

If there are no warnings, there are no warnings to be suppressed either, so
ignoring the option cannot do any harm. This allows code intended to build
warning-free to unconditionally add -Wno-* options made available in e.g. GCC
4.9 even when GCC 4.8 is used as the compiler.

If there are warnings, a diagnostic for the -Wno-* option is more useful, as it
could point to a typo in the command-line option intended to suppress one of
the current warnings, for example:

$ cat test.c
int main() { }
$ gcc -Wall -Wno-retrun-type -c test.c
test.c: In function âmainâ:
test.c:1:1: warning: control reaches end of non-void function [-Wreturn-type]
 int main() { }
 ^
test.c: At top level:
cc1: warning: unrecognized command line option "-Wno-retrun-type" [enabled by
default]

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]