Search notes:

gcc -x

Force the compiler to compile in the specified language. Without this flag, gcc determines the language by the source file's suffex.
In the following example, foo.cpp is treated as a c file rather than a c++ file, although its suffix is .cpp:
$ gcc -x c foo.cpp
Possible values for the language are:

See also

GCC options
This stackoverflow answer
The Visual C Compiler equivalent is cl /T….

Index