Suppressing specific compiler warnings
Banibrata Dutta
dutta@india.hp.com
Wed May 26 08:46:00 GMT 2004
Hi Ranjit:
Thanks for pointing it out. I'd seen the -Wno-xxx so many times,
but never thought about the reason for using it.
BTW, wouldn't it be a good feature if all warnings (and errors)
were numbered, s.t. final warning (or error) displayed is something
like a --
<number>: <warning/error message>
And then have option like -Wno-<number>... Something quite similar
to the HP compilers!
Also, this would make the process of internationalization of gcc/g++
easy.
Thanks & regards,
Banibrata Dutta
> -----Original Message-----
> From: Ranjit Mathew [ mailto:rmathew@gmail.com ]
> Sent: Wednesday, May 26, 2004 1:55 PM
> To: Banibrata Dutta
> Cc: gcc@gcc.gnu.org
> Subject: Re: Suppressing specific compiler warnings
>
>
> Banibrata Dutta wrote:
> > Hi,
> >
> > I've wondered for a long time as to why the ability to suppress
> > specific compiler warnings is missing in GCC. Has this ever been
> > discussed ? Having this would be very useful in cases where
> we treat
> > warnings and errors and cause build to break. At times there are
> > warnings which we decide to live with, because they reflect a
> > deliberate decision.
>
> See:
>
http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
Useful snippet:
"You can request many specific warnings with options
beginning -W, for example -Wimplicit to request warnings
on implicit declarations. 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."
Ranjit.
--
Ranjit Mathew Email: rmathew AT gmail DOT com
Bangalore, INDIA. Web: http://ranjitmathew.tripod.com/
More information about the Gcc
mailing list