cpplib: Suppress warnings in system headers

Zack Weinberg zack@wolery.cumb.org
Mon Aug 21 12:18:00 GMT 2000

On Mon, Aug 21, 2000 at 07:22:28PM +0100, Neil Booth wrote:
> This patch suppresses all warnings and pedantic warnings in system
> headers.  They can be turned on (off) by the new option -Win-sys
> (-Wno-in-sys).
> This is achieved by moving the checks to the diagnostic routines
> themselves.  The warning routines, e.g. cpp_warning, now return a
> boolean to indicate whether the warning was in fact emitted or not.
> This is useful for code that wants to emit warnings only once, and
> needs to know if they were actually emitted at all.

This seems to be the right general idea.  I have one concern:  I
believe there are some cpp_pedwarn() calls that are not predicated on
CPP_PEDANTIC.  These are mandatory warnings that happen to be also
mandated by ISO C (so we want -pedantic-errors to make them into
errors).  You need to find these and give them a way to do what they
need. (cpp_mandatory_pedwarn?  I don't mind the long name, these should
be rare.)

> Since warnings are now off in system headers by default, I left the
> multiline string in directive as a cpp_warning (I couldn't see that
> the justification of a DEPRECATED category remained in this light).

Mmm... I can still see value in a -Wdeprecated switch - turned on at
-Wall, but you can shut it up again if you have lots of legacy code.
This doesn't have to be done in this patch, though.

Next step is to do something similar for the compiler proper...


More information about the Gcc-patches mailing list