Extensions for GNU C/C++ compatibility

The following subset of the GNU C/C++ language extension is enabled with the LANGLVL(EXTENDED) option, which is the default language level.

Table 1. Default IBM XL C/C++ extensions for compatibility with GNU C/C++
Language feature Discussed in:
Placement of flexible array members anywhere in structure or union Flexible array members (C only)
Static initialization of flexible array members of aggregates Flexible array members (C only)
__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
__imag__ and __real__ complex type operators The __real__ and __imag__ operators (IBM extension)
Function attributes Function attributes (IBM extension)

Some extensions can also be enabled or disabled by specific compiler options, which are listed in the following table:

Table 2. Default IBM XL C/C++ extensions for compatibility with GNU C/C++, with individual option controls
Language feature Discussed in: Individual option controls
Complex literal suffixes Complex literals LANGLVL([NO]GNU_SUFFIXIJ)
Zero-extent arrays Zero-extent array members (IBM extension) LANGLVL([NO]ZEROEXTARRAY)
Labels as values Labels as values (IBM extension) LANGLVL([NO]GNU_LABELVALUE)
Computed goto statements Computed goto statement (IBM extension)

LANGLVL([NO]GNU_COMPUTEDGOTO)

inline assembly-language statements Inline assembly statements (IBM extension) ASM | NOASM