I am wondering if it is possible to disable gcc warnings about an invalid parameter for the compiled language.
Example:
cc1: warning: command line option "-Wno-deprecated" is valid for C++/Java/ObjC++ but not for C
Our build system transmits warnings that we have accepted around the world throughout the build. We have C / C ++ code, and warnings become annoying when trying to find actual warnings.
Any suggestions?
It seems to me that if there was such an option, one more option would be to turn off warnings about this parameter and so on endlessly. Therefore, I suspect not.
- , makefile .
gcc -Wxxxx -Wno-xxxx.
GCC:
, -W', for example -Wimplicit to request warnings on implicit declarations. Each of these specific warning options also has a negative form beginning -Wno- ', ; , -Wno-implicit. , , .
-W', for example -Wimplicit to request warnings on implicit declarations. Each of these specific warning options also has a negative form beginning
@Neil . make, , . C CFLAGS ++ CCFLAGS.
CFLAGS, C, CXXFLAGS, ++, .
, gcc . , , , .
, , ? , , , .
For your build system, you can define separate warning sets for different languages. What happens if you need to use some other compiler and not gcc?
When compiling your C files like C ++ is for you option -x c++.
-x c++