Extensions for GNU C compatibility

The following features are enabled by default at all language levels. For details about supported GCC features, see the GNU Compiler Collection online documentation at http://gcc.gnu.org/onlinedocs/.

Table 1. Default IBM XL C and C++ extensions for GNU C compatibility
Language feature Discussed in:
__alignof__ operator GCC online documentation
__attribute__ keyword Variable attributes, Function attributes
__complex__ keyword GCC online documentation
__extension__ keyword GCC online documentation
__imag__ and __real__ complex type operators GCC online documentation
__int128 and unsigned __int128 types GCC online documentation
__restrict__ keyword GCC online documentation
__thread storage class specifier The __thread storage class specifier
__typeof__ keyword The typeof keyword
#include_next preprocessor directive The #include_next directive
#warning preprocessor directive GCC online documentation
Alternate keywords GCC online documentation
asm inline assembly-language statements Inline assembly statements
asm labels GCC online documentation
Complex literal suffixes GCC online documentation
Computed goto statements GCC online documentation
Dollar signs in identifiers Characters in identifiers
FORTIFY_SOURCE GCC online documentation
Function attributes Function attributes
Initialization of static variables by compound literals Compound literal expressions
Labels as values GCC online documentation
Postfix and unary operators on complex types (increment, decrement, and complex conjugation) GCC online documentation
Statements and declarations in expressions (statement expressions) GCC online documentation
Static initialization of flexible array members of aggregates Flexible array members of structures
Structures with flexible array members being members of another structure Flexible array members of structures
Type attributes Type attributes
Variable attributes Variable attributes
Variadic macro extensions Variadic macros
Zero-extent arrays GCC online documentation

C only beginsThe following features are enabled by default when you compile with the xlc invocation command or the -qlanglvl=extc99 | extc89 | extc1x | extended options.C only ends

C++ only beginsThe following features are enabled by default at all C++ language levels:C++ only ends

Some features can also be enabled or disabled by specific compiler options, which are listed in the below table:
Table 2. IBM XL C and C++ extensions for GNU C compatibility with individual option controls
Language feature Discussed in: Individual option controls
typeof keyword The typeof keyword GCC online documentation
Visibility function attribute1 visibility -fvisibility (-qvisibility)
Visibility variable attribute1 The visibility variable attribute -fvisibility (-qvisibility)
Note:
  1. You can use the -fvisibility option to specify visibility attributes for variables and functions if they do not get visibility attributes from pragma directives, explicitly specified attributes, or propagation rules. This option cannot be used to disable visibility attributes for variables or functions.
  2. For details about supported GCC features, see the GNU Compiler Collection online documentation at http://gcc.gnu.org/onlinedocs/.


Voice your opinion on getting help information Ask IBM compiler experts a technical question in the IBM XL compilers forum Reach out to us