4.6.2.6 X: Specify Source Language Option

The -xlanguage option allows you to specify that the source files that follow are written in the specified language, regardless of the extension they use.

The languages allowed by the compiler are tabulated below.

Table 4-17. Language options
Language Description
assembler Assembly source code
assembler-with-cpp Assembly source code that must be preprocessed

For example, the command:

xc8-cc -mcpu=18f4520 -c -xassembler-with-cpp init.s

will tell the compiler to run the preprocessor over the assembly source file, even though the init.s file name does not use a .S extension.