Using gcc-4.8.1-1.fc19.x86_64 (but I've seen it with rhel6 gcc as well): $ touch foo.c (works with a regular C program as well such as an hello world) $ gcc -Wbadflag -c ./foo.c gcc: error: unrecognized command line option '-Wbadflag' $ gcc -Wno-badflag -c ./foo.c $ $ echo '#warning foo' >>foo.c $ gcc -Wno-badflag -c ./foo.c ./foo.c:1:2: warning: #warning foo [-Wcpp] #warning foo ^ cc1: warning: unrecognized command line option "-Wno-badflag" [enabled by default] Expected result: -Wno-badflag and -Wbadflag gives the same result when they are used on a C file not producing any warnings (in this case, an empty foo.c).
That is intentional, design decision, even documented in gcc documentation.