IBM® XL C++ adds the support for the following C99 language features. All of these features are enabled with the -qlanglvl=extended option, which is the default language level.
| Language feature | Discussed in: |
|---|---|
| Duplicate type qualifiers | Type qualifiers |
| Flexible array members at the end of a structure or union | Flexible array members |
| _Pragma operator | The _Pragma preprocessing operator |
| Additional predefined macro names | Standard predefined macro names |
| Empty arguments in function-like macros | Function-like macros |
| C standard pragmas | Standard pragmas (C only) |
The following features are enabled with the -qlanglvl=extended option, which is the default language level. They can also be enabled or disabled by specific compiler options, which are listed in the below table:
| Language feature | Discussed in: | Individual option controls |
|---|---|---|
| __func__ predefined identifier | The __func__ predefined identifier | -qlanglvl=[no]c99__func__ |
| Hexadecimal floating-point literals | Hexadecimal floating-point literals | -qlanglvl=[no]c99hexfloat |
| Complex data type | Complex floating point types | -qlanglvl=[no]c99complex |
| Trailing comma allowed in enum declaration | Enumeration type definition | -qlanglvl=[no]trailenum |
| The restrict type qualifier | The restrict type qualifier | -q[no]keyword=restrict |
| Variable length arrays | Variable length arrays (C only) | -qlanglvl=[no]c99vla |
| Compound literals | Compound literal expressions (C only) | -qlanglvl=[no]c99compoundliteral |
| Variable arguments in function-like macros | Function-like macros | -qlanglvl=[no]varargmacros |
The following feature is only enabled by a specific compiler option, listed in the below table:
| Language feature | Discussed in: | Individual option control |
|---|---|---|
| Universal character names | The Unicode standard | -qlanglvl=ucs |