You copied the Doc URL to your clipboard.

-x

Specifies the language of source files.

Syntax

-x language

Where:

language

Specifies the language of subsequent source files, one of the following:

c
C code.
c++
C++ code.
assembler-with-cpp
Assembly code containing C directives that require the C preprocessor.
assembler
Assembly code that does not require the C preprocessor.

Use the suffix -header with c or c++ to generate a Precompiled Header (PCH) file, that is -xc-header or -xc++-header. armclang creates the PCH file in the same directory as the header file, with the file suffix .gch.

Usage

This option can also be combined with the -std command-line option to specify the language standard. For example, armclang -xc -std=c99.

Default

By default the compiler determines the source file language from the filename suffix, as follows:

  • .cpp, .cxx, .c++, .cc, and .CC indicate C++, equivalent to -x c++.
  • .c indicates C, equivalent to -x c.
  • .s (lower-case) indicates assembly code that does not require preprocessing, equivalent to -x assembler.
  • .S (upper-case) indicates assembly code that requires preprocessing, equivalent to -x assembler-with-cpp.

Related reference

Was this page helpful? Yes No