1.3.3. C/C++ Language Standard Options (-std)¶
The tiarmclang compiler’s -std option allows you to specify which C or C++ language standard that compiler should adhere to when processing C or C++ source files.
The supported C and C++ language variants are described below in each section.
Note
Default C/C++ Language Standard
If no -std option is specified on the tiarmclang command line, then -std=gnu17 is assumed for C source files and -std=gnu++14 is assumed for C++ source files.
1.3.3.1. C Language Variants¶
For C <language-variants> of the form cNN, the compiler will pre-define the __STRICT_ANSI__ macro symbol to 1.
- -std=c89, -std=c90¶
C as defined in the ISO C 1990 standard
- -std=c99, -std=c9x¶
C as defined in the ISO C 1999 standard
- -std=c11, -std=c1x¶
C as defined in the ISO C 2011 standard
- -std=c17, -std=c18¶
C as defined in the ISO C 2017 standard, which addressed C11 defects without adding any new features
For C <language-variants> of the form gnuNN, GNU C language extensions are supported and the compiler will not define the __STRICT_ANSI__ macro symbol.
- -std=gnu89, -std=gnu90¶
C as defined in the ISO C 1990 standard with GNU extensions
- -std=gnu99, -std=gnu9x¶
C as defined in the ISO C 1999 standard with GNU extensions
- -std=gnu11, -std=gnu1x¶
C as defined in the ISO C 2011 standard with GNU extensions
- -std=gnu17, -std=gnu18¶
C as defined in the ISO C 2017 standard with GNU extensions
1.3.3.2. C++ Language Variants¶
Note
C++ as defined in the ISO C++ 2017 standard (C++17) is not supported.
For C++ <language-variants> of the form c++NN, the compiler will pre-define the __STRICT_ANSI__ macro symbol to 1.
- -std=c++98, -std=c++03¶
C++ as defined in the ISO C++ 1998 standard with amendments
- -std=c++11¶
C++ as defined in the ISO C++ 2011 standard with amendments
- -std=c++14¶
C++ as defined in the ISO C++ 2014 standard with amendments
For C++ <language-variants> of the form gnuNN, GNU C language extensions are supported and the compiler will not define the __STRICT_ANSI__ macro symbol.
- -std=gnu++98, -std=gnu++03¶
C++ as defined in the ISO C++ 1998 standard with amendments and GNU extensions
- -std=gnu++11¶
C++ as defined in the ISO C++ 2011 standard with amendments and GNU extensions
- -std=gnu++14¶
C++ as defined in the ISO C++ 2014 standard with amendments and GNU extensions
1.3.4. C/C++ Run-Time Standard Header and Library Options¶
- -nostdlib, --no-standard-libraries¶
Avoid linking in the C/C++ standard libraries. This is useful when partially linking an application, or when you want to link against your own AEABI-compliant libraries.
- -nostdinc, --no-standard-includes¶
Do not incorporate the C/C++ runtime header file directory, the compiler builtin include directory, or the standard system include directory in the default definition of the include file directory search path.
- -nostdlibinc¶
Do not incorporate the C/C++ runtime header file directory or the standard system include directory into the include file directory search path, but do incorporate the compiler’s builtin include directory.