This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: How can one disable gcc warnings inline with c code?
- From: LLeweLLyn Reese <llewelly at lifesupport dot shutdown dot com>
- To: Ben Davis <bnd25 at cam dot ac dot uk>
- Cc: "Jamie Risk" <jamie_risk at yahoo dot ca>, gcc-help at gcc dot gnu dot org
- Date: 19 Mar 2003 07:47:30 -0800
- Subject: Re: How can one disable gcc warnings inline with c code?
- References: <b5a1j0$qio$1@main.gmane.org> <200303191540.51274.bnd25@cam.ac.uk>
- Reply-to: gcc-help at gcc dot gnu dot org
Ben Davis <bnd25 at cam dot ac dot 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