https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63499

            Bug ID: 63499
           Summary: gcc treats unknown -Wno-xxx options differently than
                    -Wxxx
           Product: gcc
           Version: 4.9.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zbyszek at in dot waw.pl

$ echo 'int main(){}' > test.c
$ gcc -Wyyy test.c
gcc: error: unrecognized command line option ‘-Wyyy’

$ gcc -Wno-yyy test.c && echo OK
OK

$ gcc -Wall -Wno-yyy test.c && echo OK
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-yyy"
OK

Depending on whether a different a different warning is emitted, the -Wno-*
options might cause a warning or not. "Positive" -W* options always emit an
error. This makes it hard to actually detect option support in a ./configure
script.

$ rpm -q gcc
gcc-4.9.1-11.fc21.x86_64

Reply via email to