Bug 996714 - Invalid -Wno-xxxx flags are only reported in code generating other unrelated warnings
Summary: Invalid -Wno-xxxx flags are only reported in code generating other unrelated ...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc
Version: 19
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-08-13 19:01 UTC by Christophe Fergeau
Modified: 2013-08-13 19:05 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-08-13 19:05:45 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

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.


Note You need to log in before you can comment on or make changes to this bug.