7.1.3 Input File Types

The compilation driver distinguishes source files, intermediate files and library files solely by the file type, or extension. It recognizes the following file extensions, which are case-sensitive.

Table 7-2. File Names
ExtensionsDefinition
file.cA C source file that must be preprocessed.
file.hA header file (not to be compiled or linked).
file.iA C source file that should not be preprocessed.
file.oAn object file.
file.pA pre procedural-abstraction assembly language file.
file.sAssembler code.
file.SAssembler code that must be preprocessed.
otherA file to be passed to the linker.

There are no compiler restrictions imposed on the names of source files, but be aware of case, name-length and other restrictions imposed by your operating system. If you are using an IDE, avoid assembly source files whose basename is the same as the basename of any project in which the file is used. This may result in the source file being overwritten by a temporary file during the build process.

The terms “source file” and “module” are often used when talking about computer programs. They are often used interchangeably, but they refer to the source code at different points in the compilation sequence.

A source file is a file that contains all or part of a program. Source files are initially passed to the preprocessor by the driver.

A module is the output of the preprocessor, for a given source file, after inclusion of any header files (or other source files) which are specified by #include preprocessor directives. These modules are then passed to the remainder of the compiler applications. Thus, a module may consist of several source and header files. A module is also often referred to as a translation unit. These terms can also be applied to assembly files, as they too can include other header and source files.