This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Local disable of specific warnings for a section of code
- From: Tom St Denis <tstdenis at ellipticsemi dot com>
- To: Lee Rhodes <lee at rhoba dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Wed, 29 Aug 2007 08:49:48 -0400
- Subject: Re: Local disable of specific warnings for a section of code
- References: <003001c7e9ac$7091ab70$0701a8c0@lee8075b>
Lee Rhodes wrote:
> Re: GCC 3.4.4 Lang: C,C++
>
> In general I like have all warnings active, however, I have certain sections
> of code where I know a warning will be generated, but I don't want these
> warnings to clutter my build output. Is there a solution for this?
>
This is just my 2 cents (pesos, yen whatever), but most GCC warnings are
sensible. Maybe it's best to clean up the code in question instead of
trying to ignore the warnings?
Failing that, why not just factor your code so the dodgy bits are in
their own C file which you can then change the CFLAGS for.
Tom