PATCH: Wno-warning-directives [WasRe: cpplib: Start moving ...]

Stan Shebs shebs@apple.com
Mon Aug 12 17:33:00 GMT 2002


Richard Henderson wrote:

>On Mon, Aug 12, 2002 at 04:41:10PM -0700, Stan Shebs wrote:
>
>>Sure, it was handy to see the #warning the first time, but it's
>>unreasonable to expect everyone to stop using -Werror until all
>>the #warnings are removed.
>>
>
>Why?  That's what -Werror is *for* -- to prevent you 
>from ignoring warnings.  If that's not what you want,
>don't use it.
>
That's why I said "handy to see the first time".  If you have a project
carefully set up so that -Werror works, and you depend on it to catch
coding errors in your code, you're screwed if an evil header developer
adds something like

    #warning "Revisit this typedef after Jaguar ships."

I suspect it doesn't seem very important because #warning is not often
used, and so few people have bumped into the conundrum of needing to
ignore warnings issued from places that they already know they don't
care about.  Some groups within Apple use this a lot - it's there, so
why not? - and without the ability to suppress #warning, other groups
using -Werror are stuck with losing their ability to detect mistakes
in their own code.  (Note that the headers in question may not fit the
definition of "system headers".)

Stan




More information about the Gcc-patches mailing list