This is the mail archive of the
mailing list for the GCC project.
Re: Suppressing specific compiler warnings
- From: DJ Delorie <dj at redhat dot com>
- To: pinskia at physics dot uc dot edu
- Cc: shebs at apple dot com, dewar at gnat dot com, dutta at india dot hp dot com, gcc at gcc dot gnu dot org, llewelly at xmission dot com, rmathew at gmail dot com
- Date: Thu, 27 May 2004 14:54:25 -0400
- Subject: Re: Suppressing specific compiler warnings
- References: <200405271836.i4RIa6j03883@tin.geop.uc.edu>
> Another warnings should be listen to and have the source fixed
> instead of just disabled the warnings.
As has been brought up many times before in the past, there are some
warnings where the programmer really does know what they're doing and
there is no feasible way to avoid the construct. Combine this with
corporate policies of building with warnings enabled and you can see
why it would be useful for the programmer to say "I know about this
warning for this source line, ignore it, and here's why."
DJGPP's libc, for example, builds with most warnings enabled - by
policy. We have to jump through hoops to unconstify pointers in cases
where the API spec requires it, which is a pain we've hidden behind a
macro. I'd like to enable more warnings, but I can't macro-hide them
in the few cases where we can't work around them.