Extensions for GNU C compatibility

The following feature is enabled by default at all language levels:

Table 1. Default IBM® XL C extensions for GNU C compatibility
Language feature Discussed in:
#include_next preprocessor directive The #include_next directive (IBM extension)
The following features are enabled by default when you compile with any of the following commands:
  • the xlc invocation command
  • the -qlanglvl=extc99 | extc89 | extended options
Table 2. Default IBM XL C extensions for GNU C compatibility
Language feature Discussed in:
Alternate keywords Keywords for language extensions (IBM extension)
__extension__ keyword Keywords for language extensions (IBM extension)
asm labels Assembly labels (IBM extension)
Complex literal suffixes Complex literals
Global register variables Variables in specified registers (IBM extension)
Placement of flexible array members anywhere in structure or union Flexible array members
Static initialization of flexible array members of aggregates Flexible array members
Zero-extent arrays Zero-extent array members (IBM extension)
Type attributes Type attributes (IBM extension)
Variable attributes Variable attributes (IBM extension)
Locally declared labels Locally declared labels (IBM extension)
Labels as values Labels as values (IBM extension)
__alignof__ operator The __alignof__ operator (IBM extension)
__typeof__ operator The typeof operator (IBM extension)
Generalized lvalues Lvalues and rvalues
Complex type arguments to unary operators Unary expressions
Initialization of static variables by compound literals Compound literal expressions (C only)
__imag__ and __real__ complex type operators The __real__ and __imag__ operators (C only) (IBM extension)
Cast to a union type Cast to union type (C only) (IBM extension)
Computed goto statements Computed goto statement (IBM extension)
Statements and declarations in expressions Statement expressions (IBM extension)
Function attributes Function attributes (IBM extension)
__inline__ function specifier The inline function specifier
Nested functions Nested functions (IBM extension)
Variadic macro extensions Variadic macro extensions(IBM extension)
#warning preprocessor directive The #warning directive (IBM extension)
#assert, #unassert preprocessor directives Assertion directives (IBM extension)
The following features are enabled by default when you compile with any of the following commands:
  • the xlc invocation command
  • the -qlanglvl=extc99 | extc89 | extended options
They are also enabled or disabled by specific compiler options, which are listed in the below table:
Table 3. IBM XL C extensions for GNU C compatibility with individual option controls
Language feature Discussed in: Individual option controls
asm, and __asm keywords Assembly labels (IBM extension), Inline assembly statements (C only) (IBM extension) -qkeyword=asm, -qasm
asm inline assembly-language statements Inline assembly statements (C only) (IBM extension) -qasm
The following features require compilation with the use of an additional option:
Table 4. IBM XL C extensions for GNU C compatibility, requiring additional compiler options
Language feature Discussed in: Required compilation option
Dollar signs in identifiers Characters in identifiers -qdollar
The typeof keyword The typeof operator (IBM extension) -qkeyword=typeof
The __thread storage class specifier The __thread storage class specifier (IBM extension) -qtls