Macros related to language features

The following macros can be tested for enabled C99 features, features related to GNU C or C++, and other IBM language extensions. A macro is defined to the value of 1 if the listed feature is supported under the specified compiler option. If the feature is not supported, then the macro is undefined. All predefined macros are protected.

Table 44. Predefined macros for language features
Predefined macro name Description Compiler option:
__C99_BOOL Support for _Bool data type C only -qlanglvl=stdc99|extc99|extc89|extended
__C99_COMPLEX Support for complex data types C only -qlanglvl=stdc99|extc99|extc89|extended
__C99_COMPLEX_HEADERS__ Support for C99-style complex headers C++ only-qlanglvl=extended
__C99_CPLUSCMT Support for C++ style comments

C only

-qlanglvl=stdc99|extc99

-qcpluscmt
__C99_COMPOUND_LITERAL Support for compound literals C only -qlanglvl=stdc99|extc99|extc89|extended
__C99_DESIGNATED_INITIALIZER Support for designated initialization C only -qlanglvl=stdc99|extc99|extc89|extended
__C99_DUP_TYPE_QUALIFIER Support for duplicated type qualifiers C only -qlanglvl=stdc99|extc99|extc89|extended
__C99_EMPTY_MACRO_ARGUMENTS Support for empty macro arguments C only -qlanglvl=stdc99|extc99|extc89|extended

C++ only -qlanglvl=extended

__C99_FLEXIBLE_ARRAY_MEMBER Support for flexible array members C only -qlanglvl=stdc99|extc99|extc89|extended
__C99__FUNC__ Support for the __func__ keyword

C only -qlanglvl=stdc99|extc99|extc89|extended

C++ only -qlanglvl=extended

__C99_HEX_FLOAT_CONST Support for hexadecimal floating constants C only -qlanglvl=stdc99|extc99|extc89|extended

C++ only -qlanglvl=extended

__C99_INLINE Support for the inline function specifier C only -qlanglvl=stdc99|extc99

-qkeyword=inline

__C99_LLONG Support for long long data types C only -qlanglvl=stdc99|extc99
__C99_MACRO_WITH_VA_ARGS Support for function-like macros with variable arguments

C only -qlanglvl=stdc99|extc99|extc89|extended

C++ only -qlanglvl=extended

__C99_MAX_LINE_NUMBER New limit for #line directive C only -qlanglvl=stdc99|extc99|extc89|extended
__C99_MIXED_DECL_AND_CODE Support for mixed declaration and code C only -qlanglvl=stdc99|extc99|extc89|extended
__C99_MIXED_STRING_CONCAT Support for concatenation of wide string and non-wide string literals C only -qlanglvl=stdc99|extc99|extc89|extended
__C99_NON_LVALUE_ARRAY_SUB Support for non-lvalue subscripts for arrays C only -qlanglvl=stdc99|extc99|extc89|extended
__C99_NON_CONST_AGGR_INITIALIZER Support for non-constant aggregate initializers C only -qlanglvl=stdc99|extc99|extc89|extended
__C99_PRAGMA_OPERATOR Support for the _Pragma operator

C only -qlanglvl=stdc99|extc99|extc89|extended

C++ only -qlanglvl=extended

__C99_REQUIRE_FUNC_DECL Implicit function declaration not supported C only -qlanglvl=stdc99
__C99_RESTRICT Support for the restrict qualifier

C only -qlanglvl=stdc99|extc99 -qkeyword=restrict

C++ only-qlanglvl=extended -qkeyword=restrict

__C99_STATIC_ARRAY_SIZE Support for the static keyword in array parameters to functions C only -qlanglvl=stdc99|extc99|extc89|extended
__C99_STD_PRAGMAS Support for standard pragmas C only -qlanglvl=stdc99|extc99|extc89|extended
__C99_TGMATH Support for type-generic macros in tgmath.h C only -qlanglvl=stdc99|extc99|extc89|extended
__C99_UCN Support for universal character names C only -qlanglvl=stdc99|extc99|ucs

C++ only -qlanglvl=ucs

__C99_VAR_LEN_ARRAY Support for variable length arrays C only -qlanglvl=stdc99|extc99|extc89|extended
__C99_VARIABLE_LENGTH_ARRAY

C++ only extended

__IBM__ALIGNOF__ Support for the __alignof__ operator

C only -qlanglvl=extc99|extc89|extended

C++ only -qlanglvl=extended

__IBM_ALTERNATE_KEYWORDS Support for alternate keywords C only -qlanglvl=extc99|extc89|extended
__IBM_ATTRIBUTES Support for type, variable, and function attributes

C only -qlanglvl=extc99|extc89|extended

C++ only -qlanglvl=extended

__IBM_COMPUTED_GOTO Support for computed goto statements

C only -qlanglvl=extc99|extc89|extended

C++ only -qlanglvl=extended

__IBM_EXTENSION_KEYWORD Support for the __extension__ keyword

C only -qlanglvl=extc99|extc89|extended

C++ only -qlanglvl=extended

__IBM_GCC_ASM Support for GNU C inline asm statements

C only -qlanglvl=extc99|extc89|extended, -qkeyword=asm, -qasm=gcc

C++ only -qlanglvl=extended, -qasm=gcc

__IBM_GCC__INLINE__

__IBM_STDCPP_ASM

Support for the GNU 89 __inline__ specifier

C only -qlanglvl=extc99|extc89|extended

C++ only -qlanglvl=extended

__IBM_DOLLAR_IN_ID Support for dollar signs in identifiers

C only -qlanglvl=extc99|extc89|extended

__IBM_GENERALIZED_LVALUE Support for generalized lvalues

C only -qlanglvl=extc99|extc89|extended

__IBM_INCLUDE_NEXT Support for the #include_next preprocessing directive

C only -qlanglvl=extc99|extc89|extended

C++ only -qlanglvl=extended

__IBM_LABEL_VALUE Support for labels as values

C only -qlanglvl=extc99|extc89|extended

C++ only -qlanglvl=extended

__IBM_LOCAL_LABEL Support for local labels

C only -qlanglvl=extc99|extc89|extended

C++ only -qlanglvl=extended

__IBM_MACRO_WITH_VA_ARGS Support for variadic macro extensions

C only -qlanglvl=extc99|extc89|extended

C++ only -qlanglvl=extended

_IBM_NESTED_FUNCTION Support for nested functions

C only -qlanglvl=extc99|extc89|extended

__IBM_PP_PREDICATE Support for #assert, #unassert, #cpu, #machine, and #system preprocessing directives

C only -qlanglvl=extc99|extc89|extended

__IBM_PP_WARNING Support for the #warning preprocessing directive

C only -qlanglvl=extc99|extc89|extended

__IBM_REGISTER_VARS Support for variables in specified registers

C only

__IBM_STDCPP_ASM Support for asm statements. If assembler code is generated, the macro has the value 1; otherwise, 0

C++ only

__IBM__TYPEOF__ Support for the __typeof__ keyword

C only -qlanglvl=extc99|extc89|extended, -qkeyword=typeof

C++ only -qlanglvl=extended, -qkeyword=typeof

__IBM_UTF_LITERALS Support for UTF-16 and UTF-32 string literals

C only -qlanglvl=extc99|extc89|extended

C++ only -qlanglvl=extended

__IBMCPP_TR1__ Support for unordered associative containers (TR1 library extensions) in namespace std::tr1

C++ only -qlanglvl=extended