Keil Logo

Supported GNU extensions

13.1 Supported GNU extensions

Describes ARM compiler support for GNU extensions to the C and C++ languages.

Table 13-1 Supported GNU extensions

GNU extension Origin Modes supported
9.4 __alignof__ GCC-Specific. C90, C99, C++, GNU C90, GNU C99, GNU C++.
Aggregate initializer elements for automatic variables Standard C99, Standard C++. C99, C++, GNU C90, GNU C99, GNU C++.
Alternate keywords GCC-specific. GNU C90, GNU C99, GNU C++.
asm keyword a Standard C++. C++, GNU C90, GNU C++.
Assembler labels - C90, C99, C++, GNU C90, GNU C99, GNU C++.
Case ranges GCC-specific. GNU C90, GNU C99, GNU C++.
Cast of a union GCC-specific. GNU C90, GNU C99.
Character escape sequence GCC-specific. GNU C90, GNU C99, GNU C++.
Compound literals Standard C99. C99, GNU C90, GNU C99, GNU C++.
Conditional statements with omitted operands GCC-specific. GNU C90, GNU C99, GNU C++.
Designated initializers Standard C99. C99, GNU C90, GNU C99, GNU C++.
Dollar signs in identifiers GCC-specific. GNU C90, GNU C99, GNU C++.
Extended lvalues b Standard C++. C++, GNU C90, GNU C99, GNU C++.
9.28 Function attributes - C90, C99, C++, GNU C90, GNU C99, GNU C++.
9.154 GNU built-in functions - -
Inline functions Standard C99, Standard C++. C99, C++, GNU C90, GNU C99, GNU C++.
Labels as values GCC-specific. GNU C90, GNU C99, GNU C++.
Pointer arithmetic on void pointers and function pointers GCC-specific. GNU C90, GNU C99.
Statement expressions GCC-specific. GNU C90, GNU C99, GNU C++.
Unnamed embedded structures or unions GCC-specific. GNU C90, GNU C99, GNU C++.
9.29 __attribute__((alias)) function attribute GCC-specific. C90, C99, C++, GNU C90, GNU C99, GNU C++.
9.56 __attribute__((aligned)) type attribute GCC-specific. C90, C99, C++, GNU C90, GNU C99, GNU C++.
9.61 __attribute__((aligned)) variable attribute GCC-specific. C90, C99, C++, GNU C90, GNU C99, GNU C++.
9.30 __attribute__((always_inline)) function attribute GCC-specific. C90, C99, C++, GNU C90, GNU C99, GNU C++.
9.31 __attribute__((const)) function attribute GCC-specific. C90, C99, C++, GNU C90, GNU C99, GNU C++.
GCC-specific. C90, C99, C++, GNU C90, GNU C99, GNU C++.
9.62 __attribute__((deprecated)) variable attribute GCC-specific. C90, C99, C++, GNU C90, GNU C99, GNU C++.
9.33 __attribute__((destructor[(priority)])) function attribute GCC-specific. C90, C99, C++, GNU C90, GNU C99, GNU C++.
9.34 __attribute__((format)) function attribute GCC-specific. C90, C99, C++, GNU C90, GNU C99, GNU C++.
9.35 __attribute__((format_arg(string-index))) function attribute GCC-specific. C90, C99, C++, GNU C90, GNU C99, GNU C++.
9.36 __attribute__((malloc)) function attribute GCC-specific. C90, C99, C++, GNU C90, GNU C99, GNU C++.
9.37 __attribute__((noinline)) function attribute GCC-specific. C90, C99, C++, GNU C90, GNU C99, GNU C++.
9.38 __attribute__((no_instrument_function)) function attribute GCC-specific. C90, C99, C++, GNU C90, GNU C99, GNU C++.
9.40 __attribute__((nonnull)) function attribute GCC-specific. C90, C99, C++, GNU C90, GNU C99, GNU C++.
9.41 __attribute__((noreturn)) function attribute GCC-specific. C90, C99, C++, GNU C90, GNU C99, GNU C++.
9.43 __attribute__((nothrow)) function attribute GCC-specific. C90, C99, C++, GNU C90, GNU C99, GNU C++.
9.57 __attribute__((packed)) type attribute GCC-specific. GNU C90, GNU C99, GNU C++.
9.64 __attribute__((packed)) variable attribute GCC-specific. C90, C99, GNU C90, GNU C99, GNU C++.
9.45 __attribute__((pure)) function attribute GCC-specific. C90, C99, C++, GNU C90, GNU C99, GNU C++.
9.65 __attribute__((section("name"))) variable attribute GCC-specific. C99, GNU C90, GNU C99, GNU C++.
9.47 __attribute__((sentinel)) function attribute GCC-specific. C90, C99, C++, GNU C90, GNU C99, GNU C++.
GCC-specific. GNU C90, GNU C99.
9.66 __attribute__((unused)) variable attribute GCC-specific. C90, C99, C++, GNU C90, GNU C99, GNU C++.
9.67 __attribute__((used)) variable attribute GCC-specific. C90, C99, GNU C90, GNU C99.
9.68 __attribute__((visibility("visibility_type"))) variable attribute GCC-specific. C90, C99, C++, GNU C90, GNU C99, GNU C++.
9.51 __attribute__((warn_unused_result)) GCC-specific. C90, C99, C++, GNU C90, GNU C99, GNU C++.
9.52 __attribute__((weak)) function attribute GCC-specific. C90, C99, C++, GNU C90, GNU C99, GNU C++.
9.69 __attribute__((weak)) variable attribute GCC-specific. C90, C99, C++, GNU C90, GNU C99, GNU C++.
9.53 __attribute__((weakref("target"))) function attribute GCC-specific. C90, C99, C++, GNU C90, GNU C99, GNU C++.
9.70 __attribute__((weakref("target"))) variable attribute GCC-specific. C90, C99, C++, GNU C90, GNU C99, GNU C++.
Variadic macros Standard C99. C90, C99, C++, GNU C90, GNU C99, GNU C++.
Zero-length arrays GCC-specific. GNU C90, GNU C99.
Related reference
a Only basic syntax is supported. That is, asm("assembly code"). GNU extended syntax is not supported.
b
Only accepted for certain values of --gnu_version.
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.