I'm trying to compile C and C++ sources together using GCC.
gcc -std=c++0x test.cpp -std=c99 test.c -lstdc++
Now, this works fine, except that I get two warnings.
cc1plus: warning: command line option "-std=c99" is valid for C/ObjC but not for C++
cc1: warning: command line option "-std=c++0x" is valid for C++/ObjC++ but not for C
Therefore I can't use -Werror with this setup. Can these warnings be suppressed somehow?
.cppfile, the compiler will fall back to its default, which is C++98. You're therefore compiling the C file in C99, and the C++ file in C++98. While parsing options, GCC sees that you have incompatible files for either language version option, thus it ouputs warnings for each option.