9.45 GNU extensions to the C and C++ languages

GNU provides many extensions to the C and C++ languages, and the ARM compiler supports many of these extensions. In GNU mode, all the GNU extensions to the relevant source language are available. Some GNU extensions are also available when you compile in a nonstrict mode.

To compile in GNU mode, use --gnu.

The following Standard C99 features are supported as GNU extensions in C90 and C++ when GNU mode is enabled:

  • Compound literals.

  • Designated initializers.

  • Elements of an aggregate initializer for an automatic variable are not required to be constant expressions.

The asm keyword is a Standard C++ feature that is supported as a GNU extension in C90 when GNU mode is enabled.

The following features are not part of any ISO standard but are supported as GNU extensions in either C90, C99, or C++ modes, when GNU mode is enabled:

  • Alternate keywords (C90, C99, C++).

  • Case ranges (C90, C99, C++).

  • Character escape sequence '\e' for escape character <ESC> (ASCII 27), (C90, C99, C++).

  • Dollar signs in identifiers (C90, C99, C++).

  • Labels as values (C90, C99 and C++).

  • Omission of middle operand in conditional statement if result is to be same as the test (C90, C99, C++).

  • Pointer arithmetic on void pointers and function pointers (C90 and C99 only).

  • Statement expressions (C90, C99 and C++).

  • Union casts (C90 and C99 only).

  • Unnamed fields in embedded structures and unions (C90, C99 and C++).

  • Zero-length arrays (C90 and C99 only).

Related reference
2.7 Filename suffixes recognized by the compiler
14.1 Supported GNU extensions
Related information
Which GNU language extensions are supported by the ARM Compiler?
Non-ConfidentialPDF file icon PDF versionARM DUI0472J
Copyright © 2010-2013 ARM. All rights reserved.