public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug other/61106] New: [4.8/4.9/4.10 Regression] impliedness of -Wunused-parameter depends on -W option ordering
@ 2014-05-07 22:39 doko at gcc dot gnu.org
  2014-05-08  7:54 ` [Bug driver/61106] " rguenth at gcc dot gnu.org
                   ` (19 more replies)
  0 siblings, 20 replies; 21+ messages in thread
From: doko at gcc dot gnu.org @ 2014-05-07 22:39 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 61106
           Summary: [4.8/4.9/4.10 Regression] impliedness of
                    -Wunused-parameter depends on -W option ordering
           Product: gcc
           Version: 4.8.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: other
          Assignee: unassigned at gcc dot gnu.org
          Reporter: doko at gcc dot gnu.org

[forwarded from http://bugs.debian.org/747345]

Whether various combinations of options imply -Wunused-parameter in
the presence of -Wno-unused depends on where on the command line
-Wno-unused appears:

sid$ cat tt.c
void foo(int x) { }
sid$ gcc-4.8 -g -O2 -Wall -Wno-unused -W  -c tt.c
sid$ gcc-4.8 -g -O2 -Wall -W -Wno-unused  -c tt.c
tt.c: In function 'foo':
tt.c:1:14: warning: unused parameter 'x' [-Wunused-parameter]
 void foo(int x) { }
              ^
sid$

This is confusing, to say the least.  It doesn't appear to be
discussed in the documentation, and differs from 4.7.2:

wheezy$ gcc-4.7 -g -O2 -Wall -Wno-unused -W  -c tt.c
wheezy$ gcc-4.7 -g -O2 -Wall -W -Wno-unused  -c tt.c
wheezy$

I think this new behaviour is counterintuitive and I prefer the old
behaviour.  But if the new behaviour is considered desirable, the
exact semantics should be explained.  I did some quick experiments,
but I haven't been able to come up with a coherent explanation.

Consider, for example, this, which is all what I would have expected
but appears not to be consistent with the sid transcript above:

sid$ gcc-4.8 -g -O2 -Wunused -W  -c tt.c
tt.c: In function 'foo':
tt.c:1:14: warning: unused parameter 'x' [-Wunused-parameter]
 void foo(int x) { }
              ^
sid$ gcc-4.8 -g -O2 -W -Wunused  -c tt.c
tt.c: In function 'foo':
tt.c:1:14: warning: unused parameter 'x' [-Wunused-parameter]
 void foo(int x) { }
              ^
sid$ gcc-4.8 -g -O2 -W  -c tt.c
sid$ gcc-4.8 -g -O2 -W -Wunused -Wno-unused  -c tt.c
sid$ gcc-4.8 -g -O2 -Wunused -W -Wno-unused  -c tt.c
sid$


^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2015-06-26 20:33 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-07 22:39 [Bug other/61106] New: [4.8/4.9/4.10 Regression] impliedness of -Wunused-parameter depends on -W option ordering doko at gcc dot gnu.org
2014-05-08  7:54 ` [Bug driver/61106] " rguenth at gcc dot gnu.org
2014-05-08  8:33 ` manu at gcc dot gnu.org
2014-05-08 10:53 ` doko at gcc dot gnu.org
2014-05-08 11:10 ` manu at gcc dot gnu.org
2014-05-08 11:37 ` doko at gcc dot gnu.org
2014-05-08 12:54 ` manu at gcc dot gnu.org
2014-05-08 22:18 ` doko at gcc dot gnu.org
2014-05-08 22:58 ` doko at gcc dot gnu.org
2014-05-08 23:00 ` doko at gcc dot gnu.org
2014-05-09 19:27 ` schwab@linux-m68k.org
2014-05-09 22:09 ` manu at gcc dot gnu.org
2014-05-14 16:18 ` doko at gcc dot gnu.org
2014-05-22  9:01 ` rguenth at gcc dot gnu.org
2014-06-18  6:27 ` burnus at gcc dot gnu.org
2014-06-18  9:45 ` manu at gcc dot gnu.org
2014-06-26 13:04 ` rguenth at gcc dot gnu.org
2014-12-19 13:34 ` [Bug driver/61106] [4.8/4.9] " jakub at gcc dot gnu.org
2015-06-23  8:14 ` rguenth at gcc dot gnu.org
2015-06-26 20:03 ` jakub at gcc dot gnu.org
2015-06-26 20:33 ` jakub at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).