How to disable the specified warning for the specified file when using autotools?

I use autotools to manage my CPP project. When compiling my code, gcc has the following flags:-Wall -Werror

So, when there is a warning in my code, gcc will treat it as an error, compilation will be aborted.

My project also includes antlr3, which generate multiple files. The generated files contain several warnings that interrupt compilation.

error: unused variable ‘index21_49’
in CongerCQLLexer.c, line 20589, column 24
20587>                 ANTLR3_UINT32 LA21_49;
20588> 
20589>                 ANTLR3_MARKER index21_49;
20590> 
20591> 

error: unused variable ‘index21_131’
in CongerCQLLexer.c, line 20622, column 24
20620>                 ANTLR3_UINT32 LA21_131;
20621> 
20622>                 ANTLR3_MARKER index21_131;
20623> 
20624> 

I want to know how to disable warnings for generated files? thank.

+3
source share
2 answers

, -Wall -Werror . CFLAGS configure.ac, . CFLAGS - . AM_CFLAGS, foo_CFLAGS. -Wall -Werror CFLAGS , , . , "-Werror - "? (?) -Wall -Werror, , , , , -Werror, , . .

Automake , , , , . CFLAGS BUILT_CFLAGS, foo_CFLAGS foo. - (.. -Werror CFLAGS, -Werror.)

+1

, , , - GCC . . / SO :

fooobar.com/questions/43640/...

+1

All Articles