Can I disable the "-Werror" compile flag for some code blocks?

Ian Lance Taylor ian@airs.com
Mon Aug 29 08:18:00 GMT 2005


Jules Colding <colding@omesc.com> writes:

> I would like to use "-Werror" when compiling to make sure that I catch
> all warnings. 
> 
> The problem is that I need to include a few ORBit2 implementation
> skeleton files in my source. Some impl_foo__create() functions for
> interfaces declared in the IDL file, but not used in the code, give rise
> to "defined but not used" warnings.  
> 
> I would like to disable "-Werror" for these specific functions/code
> blocks if possible. Can I do that with gcc?

You can't turn off -Werror for specific functions or blocks by code
(although there is some work being done toward implementing that in
some future release).  But you can compile specific files with
-Wno-warn-unused-function.

Ian



More information about the Gcc-help mailing list