Suppressing specific compiler warnings
llewelly@xmission.com
llewelly@xmission.com
Thu May 27 21:08:00 GMT 2004
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.
More information about the Gcc
mailing list