5.1 Characteristics of ARM C
The C compiler supports the 1989, 1999, and 2011 versions of the C language:
- C89. Compiling with the --c89 option causes the compiler to conform to the ISO/IEC 9899:1990 C standard, which was previously ratified as ANSI X3.159-1989. The names "C89" and "C90" refer to the same programming language. "C89" is used in this document.
- C99. Compiling with the --c99 option causes the compiler to conform to the ISO/IEC 9899:1999 C standard.
- C11. Compiling with the --c11 option causes the compiler to conform to the ISO/IEC 9899:2011 C standard.
The C language is also described in the second edition of Kernighan and Ritchie's The C Programming Language (K&R). The compiler can also accept many of the language extensions found in the GNU C compiler (see Section 5.17).
The compiler supports some features of C99 and C11 in the default relaxed ANSI mode with C89 support. It supports all language features of C99 in C99 mode and all language features of C11 in C11 mode. See Section 5.16.
The atomic operations in C11 are supported in the relaxed ANSI mode (on by default) and in C11 mode as follows:
- On ARM V7A8 (Cortex-A8), ARM V7M3 (Cortex-M3), ARM V7M4 (Cortex-M4), ARM V7R4 (Cortex-R4), and ARM V7R5 (Cortex-R5)), atomic operations are implemented using processor-supported exclusive access instructions.
- On ARM V6M0 (Cortex-M0), atomic operations are implemented by disabling interrupts across the operation.
- On ARM V4 (ARM7), ARM V5e (ARM9E), and ARM V6 (ARM11), atomic operations are not supported.
In addition, the compiler supports many of the features described in the ARM C Language Extensions (ACLE) specification. These features are applicable for the Cortex-M and Cortex-R processor variants. ACLE support affects the pre-defined macros (Table 2-31), function attributes (Section 5.17.2), and intrinsics (Section 5.14) you may use in C/C++ code. These features are implemented in order to support the development of source code that can be compiled using ACLE-compliant compilers from multiple vendors for a variety of ARM processors.
The ANSI/ISO standard identifies some features of the C language that may be affected by characteristics of the target processor, run-time environment, or host environment. This set of features can differ among standard compilers.
Unsupported features of the C library are:
- The run-time library has minimal support for wide characters. The type wchar_t is implemented as unsigned short (16 bits), but can be an int if you set the --wchar_t=32 option. The wide character set is equivalent to the set of values of type char. The library includes the header files <wchar.h> and <wctype.h>, but does not include all the functions specified in the standard. See Section 5.6 for information about extended and multibyte character sets.
- The run-time library includes the header file <locale.h>, but with a minimal implementation. The only supported locale is the C locale. That is, library behavior that is specified to vary by locale is hard-coded to the behavior of the C locale, and attempting to install a different locale by way of a call to setlocale() will return NULL.
- Some run-time functions and features in the C99/C11 specifications are not supported. See Section 5.16.