Suppressing specific compiler warnings
DJ Delorie
dj@redhat.com
Thu May 27 18:54:00 GMT 2004
> 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.
More information about the Gcc
mailing list