How can one disable gcc warnings inline with c code?

LLeweLLyn Reese llewelly@lifesupport.shutdown.com
Wed Mar 19 15:56:00 GMT 2003


Ben Davis <bnd25@cam.ac.uk> writes:

> On Wednesday 19 March 2003 3:16 pm, Jamie Risk wrote:
> > A few system libraries are giving me grief by causing numerous warnings in
> > otherwise 'clean' or warning free code.  Without disabling the warning
> > checking at the command line is there a way to disable the warnings inline?
> 
> Have you tried -Wno-system-headers?

-Wno-system-headers is the default. However, gcc needs some way to
    determine if a header is a system header. That way is:

    #pragma GCC system_header

See:

http://gcc.gnu.org/onlinedocs/gcc-3.2.2/cpp/System-Headers.html#System%20Headers

and the -Wsystem-header entry at:

http://gcc.gnu.org/onlinedocs/gcc-3.2.2/gcc/Warning-Options.html#Warning%20Options

    



More information about the Gcc-help mailing list