This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Suppressing specific compiler warnings
- From: llewelly at xmission dot com
- To: Andrew Pinski <pinskia at physics dot uc dot edu>
- Cc: shebs at apple dot com (Stan Shebs), dewar at gnat dot com (Robert Dewar), dutta at india dot hp dot com (Banibrata Dutta), gcc at gcc dot gnu dot org, rmathew at gmail dot com ('Ranjit Mathew')
- Date: 27 May 2004 15:08:45 -0600
- Subject: Re: Suppressing specific compiler warnings
- References: <200405271836.i4RIa6j03883@tin.geop.uc.edu>
Andrew Pinski <pinskia@physics.uc.edu> writes:
> >
> > Robert Dewar wrote:
> >
> > > One general and significant drawback of these complex schemes
> > > for naming or numbering warnings is that they make it
> > > significantly more work to introduce new warnings, and that
> > > is an unfortunate scenario.
> >
> > Part of my proposal of a year ago was to have the name be supplied
> > as part of the warning, so you'd say something like
> >
> > if (...)
> > WARN(unbuttoned_fly, "your fly is unbuttoned");
> >
> > where WARN is a macro that would expand into
> > "if (warn_unbuttoned_fly) warn (...);" etc.
> >
> > Whatever the details of the scheme, the mass of warning control
> > infrastructure should be auto-constructed.
>
> To me if someone does not want any warning they then should not
> care fo any, as the warnings in gcc are usually for there for a
> reason, like someone if gcc got bitten by that construct, aka
> signed vs unsinged warning.
GCC has a few warning flags, such as -Weffc++, whose utility is
strongly dependent on the style the code is written in, and a few
others, such as -Wunitialized, which are usually desireable, but
sometimes need to be turned off when one has an unusual need, such
as avoid unecessary initialization of a multi-megabyte array which
is going to be filled with input.