public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/45411]  New: Please add "-Wno-unused-variable" and friends compiler warning options
@ 2010-08-26  9:01 noloader at gmail dot com
  2010-08-26  9:09 ` [Bug c++/45411] " noloader at gmail dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: noloader at gmail dot com @ 2010-08-26  9:01 UTC (permalink / raw)
  To: gcc-bugs

Hello,

"-Wno-unused-variable" and friends such as "-Wno-unused-parameter" would be
welcome additions for folks who like to use "-Wall" and "-Wextra".

Reasons it would be a good idea to include the "-no" forms:
(1) its easy to remember
(2) its easy to use
(3) when using "-Wall" and "-Wextra", the noise created by the various unused
warnings drowns out other issues which should get attention
(4) there's nothing intuitive about the 'unused' attribute so one might have to
actually RTFM
(5) I'm lazy and don't want to locate the applicable man page for the proper
usage of the 'unused' attribute
(6) the 'unused' attribute requires modifications to source files at all
applicable declarations (and non-use)
(7) makefile friendly solutions, such as "-Wno-unused-parameter", means one
only has to change one file
(8) I'm lazy and don't want to change every declaration with an 'unused'
attribute
(9) no easy way to control 'unused warning' spew is one of the biggest
complaints on the crypto++ mailing list when building for *nix


-- 
           Summary: Please add "-Wno-unused-variable" and friends compiler
                    warning options
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: noloader at gmail dot com


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


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

* [Bug c++/45411] Please add "-Wno-unused-variable" and friends compiler warning options
  2010-08-26  9:01 [Bug c++/45411] New: Please add "-Wno-unused-variable" and friends compiler warning options noloader at gmail dot com
@ 2010-08-26  9:09 ` noloader at gmail dot com
  2010-08-26  9:23 ` jakub at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: noloader at gmail dot com @ 2010-08-26  9:09 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from noloader at gmail dot com  2010-08-26 09:09 -------
Though (5) and (8) are specific to me, there's nothing really special about me
- there's probably lots of lazy programmers who would also like the warning
options.


-- 


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


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

* [Bug c++/45411] Please add "-Wno-unused-variable" and friends compiler warning options
  2010-08-26  9:01 [Bug c++/45411] New: Please add "-Wno-unused-variable" and friends compiler warning options noloader at gmail dot com
  2010-08-26  9:09 ` [Bug c++/45411] " noloader at gmail dot com
@ 2010-08-26  9:23 ` jakub at gcc dot gnu dot org
  2010-08-26 10:15 ` redi at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu dot org @ 2010-08-26  9:23 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from jakub at gcc dot gnu dot org  2010-08-26 09:23 -------
There of course are
-Wno-unused-{function,label,parameter,value,variable,but-set-{parameter,variable}}
options.


-- 


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


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

* [Bug c++/45411] Please add "-Wno-unused-variable" and friends compiler warning options
  2010-08-26  9:01 [Bug c++/45411] New: Please add "-Wno-unused-variable" and friends compiler warning options noloader at gmail dot com
  2010-08-26  9:09 ` [Bug c++/45411] " noloader at gmail dot com
  2010-08-26  9:23 ` jakub at gcc dot gnu dot org
@ 2010-08-26 10:15 ` redi at gcc dot gnu dot org
  2010-08-26 14:55 ` noloader at gmail dot com
  2010-08-26 15:09 ` redi at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: redi at gcc dot gnu dot org @ 2010-08-26 10:15 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from redi at gcc dot gnu dot org  2010-08-26 10:14 -------
You didn't say which version of GCC you're using, but it doesn't really matter
because these options have been in place for many years.

(In reply to comment #0)
> (5) I'm lazy and don't want to locate the applicable man page

Here it is:
http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html

> (9) no easy way to control 'unused warning' spew is one of the biggest
> complaints on the crypto++ mailing list when building for *nix

This gives neither "unused variable" not "unused parameter" warnings:
void f(int) {
  int j = 0;
  (void)j;
}
But if that's not easy enough, just use relevant -Wno-... option.


-- 

redi at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


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


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

* [Bug c++/45411] Please add "-Wno-unused-variable" and friends compiler warning options
  2010-08-26  9:01 [Bug c++/45411] New: Please add "-Wno-unused-variable" and friends compiler warning options noloader at gmail dot com
                   ` (2 preceding siblings ...)
  2010-08-26 10:15 ` redi at gcc dot gnu dot org
@ 2010-08-26 14:55 ` noloader at gmail dot com
  2010-08-26 15:09 ` redi at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: noloader at gmail dot com @ 2010-08-26 14:55 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from noloader at gmail dot com  2010-08-26 14:54 -------
> You didn't say which version of GCC you're using, but it doesn't really matter
> because these options have been in place for many years.
Moot point indeed!  But for completeness....
$ gcc --version
gcc (Ubuntu 4.4.3-4ubuntu5) 4.4.3
$  uname -a
Linux studio 2.6.32-24-generic #41-Ubuntu SMP Thu Aug 19 01:38:40 UTC 2010
x86_64 GNU/Linux

> (In reply to comment #0)
>> (5) I'm lazy and don't want to locate the applicable man page

> Here it is:
> http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
Interesting. I was going to cite the same page.

Searching for "-Wno-unused-parameter" on the page returns 0 results. Under
"-Wunused-parameter", the page states, "Warn whenever a function parameter is
unused aside from its declaration. To suppress this warning use the `unused'
attribute (see Variable Attributes)." (But no mention of
-Wno-unused-parameter).

Since I feel like a total ass, perhaps someone can close this feature request.

JW


-- 


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


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

* [Bug c++/45411] Please add "-Wno-unused-variable" and friends compiler warning options
  2010-08-26  9:01 [Bug c++/45411] New: Please add "-Wno-unused-variable" and friends compiler warning options noloader at gmail dot com
                   ` (3 preceding siblings ...)
  2010-08-26 14:55 ` noloader at gmail dot com
@ 2010-08-26 15:09 ` redi at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: redi at gcc dot gnu dot org @ 2010-08-26 15:09 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from redi at gcc dot gnu dot org  2010-08-26 15:09 -------
(In reply to comment #4)
> 
> > (In reply to comment #0)
> >> (5) I'm lazy and don't want to locate the applicable man page
> 
> > Here it is:
> > http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
> Interesting. I was going to cite the same page.
> 
> Searching for "-Wno-unused-parameter" on the page returns 0 results. Under
> "-Wunused-parameter", the page states, "Warn whenever a function parameter is
> unused aside from its declaration. To suppress this warning use the `unused'
> attribute (see Variable Attributes)." (But no mention of
> -Wno-unused-parameter).

Near the top of the page, in the paragraph beginning "you can request" it says:

"Each of these specific warning options also has a negative form beginning
`-Wno-' to turn off warnings; for example, -Wno-implicit. This manual lists
only one of the two forms, whichever is not the default."

It would be a waste of time to say it on every option.

> Since I feel like a total ass, perhaps someone can close this feature request.

It's closed :-)


-- 


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


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

end of thread, other threads:[~2010-08-26 15:09 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-26  9:01 [Bug c++/45411] New: Please add "-Wno-unused-variable" and friends compiler warning options noloader at gmail dot com
2010-08-26  9:09 ` [Bug c++/45411] " noloader at gmail dot com
2010-08-26  9:23 ` jakub at gcc dot gnu dot org
2010-08-26 10:15 ` redi at gcc dot gnu dot org
2010-08-26 14:55 ` noloader at gmail dot com
2010-08-26 15:09 ` redi at gcc dot gnu dot 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).