GCC and File Extensions
||C header file (not to be compiled or linked).||
||C source code which must be preprocessed.||
||C source code which should not be preprocessed.||
||C++ source code which should not be preprocessed.||C++ source code which must be preprocessed.||
||Fortran source code which should not be preprocessed.||
||Fortran source code which must be preprocessed (with the traditional preprocessor).||
||Fortran source code which must be preprocessed with a RATFOR preprocessor (not included with GCC).||
||Assembler code which must be preprocessed.||other||An object file to be fed straight into linking. Any file name with no recognized suffix is treated this way.|
An alternative is to use the
-x option of GCC to specify
the language of input files explicitly.
-x none is the same as the default behaviour, and causes
files to be handled according to their extension.
Other options include
-x c++, and
Yet another alternative is to use
These programs invoke
gcc with appropriate options for
C++ and Fortran.