Keil Logo

Technical Support

On-Line Manuals

Compiler User Guide

Preface Overview of the Compiler Getting Started with the Compiler Compiler Features Compiler Coding Practices Compiler Diagnostic Messages Using the Inline and Embedded Assemblers of the AR Compiler Command-line Options Language Extensions Preprocessor extensions #assert #include_next #unassert #warning C99 language features available in C90 // comments Subscripting struct Flexible array members C99 language features available in C++ and C90 Variadic macros long long restrict Hexadecimal floats Standard C language extensions Constant expressions Array and pointer extensions Block scope function declarations Dollar signs in identifiers Top-level declarations Benign redeclarations External entities Function prototypes Standard C++ language extensions ? operator Declaration of a class member friend Read/write constants Scalar type constants Specialization of nonmember function templates Type conversions Standard C and Standard C++ language extensions Address of a register variable Arguments to functions Anonymous classes, structures and unions Assembler labels Empty declaration Hexadecimal floating-point constants Incomplete enums Integral type extensions Label definitions Long float Nonstatic local variables Structure, union, enum, and bitfield extensions GNU extensions to the C and C++ languages Compiler-specific Features C and C++ Implementation Details What is Semihosting? Via File Syntax Summary Table of GNU Language Extensions Standard C Implementation Definition Standard C++ Implementation Definition C and C++ Compiler Implementation Limits

GNU extensions to the C and C++ languages

8.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).
Non-ConfidentialPDF file icon PDF versionARM DUI0375H
Copyright © 2007, 2008, 2011, 2012, 2014-2016 ARM. All rights reserved. 
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.