1.58 -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.

Usage

-x overrides the default language standard for the subsequent input files that follow it on the command-line. For example:
armclang inputfile1.s -xc inputfile2.s inputfile3.s
In this example, armclang treats the input files as follows:
  • inputfile1.s appears before the -xc option, so armclang treats it as assembly code because of the .s suffix.
  • inputfile2.s and inputfile3.s appear after the -xc option, so armclang treats them as C code.

Note

Use -std to set the default language standard.

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
1.47 -std
Non-ConfidentialPDF file icon PDF versionARM DUI0774E
Copyright © 2014-2016 ARM. All rights reserved.