Bug 996714

Summary: Invalid -Wno-xxxx flags are only reported in code generating other unrelated warnings
Product: [Fedora] Fedora Reporter: Christophe Fergeau <cfergeau>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 19CC: jakub, law
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-08-13 19:05:45 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Christophe Fergeau 2013-08-13 19:01:34 UTC
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).

Comment 1 Jakub Jelinek 2013-08-13 19:05:45 UTC
That is intentional, design decision, even documented in gcc documentation.