3.4. GNU extensions to the ARM compiler

This section describes the GNU compiler extensions that are supported by the ARM compiler. These extensions are supported when you run the compiler with the --gnu option. However, some extensions are also supported when you run the compiler without this option. These compilation modes are referred to in this document as:

ARM mode

The default mode. That is, compilations without the --gnu option.

GNU mode

Compilations with the --gnu option.

Table 3.4 lists the GNU extensions that are supported by the ARM compiler, and the mode and language in which they are supported.

Table 3.4. Supported GNU extensions 

GNU extensionSupported modeSupported language
AlignmentGNU, ARMC, C++
Alternate keywordsGNUC, C++
Assembler labelsGNUC, C++
Attribute syntaxGNU, ARM[1]C, C++
Builtin functionsGNUC, C++
C++ commentsGNU, ARMC, C++
Case rangesGNUC, C++
Cast of a unionGNUC only
Character escapesGNUC, C++
Compound literalsGNUC only
ConditionalsGNUC only
Designated initsGNUC, C++
Dollar signsGNUC, C++
Function attributesGNU, ARMC, C++
Function namesGNU, ARMC only
Function prototypesGNUC only
Hex floatsGNUC, C++
Incomplete enumsGNU, ARMC, C++
InitializersGNUC, C++
InlineGNU, ARMC, C++
Local labelsGNUC, C++
Long longGNU, ARMC, C++
LvaluesGNUC, C++
Multiline stringsGNUC, C++
Pointer arithmeticGNUC, C++
Return and frame addressesGNUC, C++
Statement expressionsGNUC, C++
Subscripting structGNU, ARMC, C++
Type attributesGNU, ARMaC, C++
typeofGNUC, C++
Unnamed fieldsGNUC, C++
Variable attributesGNU, ARMaC, C++
Variadic macrosGNU, ARMC, C++
Zero length arraysGNUC, C++

[1] the transparent_union attribute is only supported in GNU mode

Note

For more details on the use of these extensions, see the GNU compiler documentation. You can access this documentation online at http://gcc.gnu.org.

Copyright © 2005 ARM Limited. All rights reserved.ARM DUI 0282B
Non-Confidential