I am trying to compile a C++ project in Visual Studio 2010.
It contains many C++ files and it also has a couple of C files.
Because it is a C++ project and the warning level is set to /W4 I am getting a lot of warnings on the C source code.
Is there a way to select the C compiler for C source code and the C++ compiler for C++ source code?
Normally, the file extension will be used to hint a default compilation mode. If for some reason the compilation mode was overriden, you can set it manually:
Go to properties of your C file. Inside: Configuration Properties –> C/C++ –> Advanced –> Compile As –> Compile as C code.