-qwarn0x (C++11)

Note: IBM supports selected features of C++11, known as C++0x before its ratification. IBM will continue to develop and implement the features of this standard. The implementation of the language level is based on IBM's interpretation of the standard. Until IBM's implementation of all the C++11 features is complete, including the support of a new C++11 standard library, the implementation might change from release to release. IBM makes no attempt to maintain compatibility, in source, binary, or listings and other compiler interfaces, with earlier releases of IBM's implementation of the new C++11 features.

Pragma equivalent

None.

Purpose

Controls whether to inform users with messages about differences in their programs caused by migration from the C++98 standard to the C++11 standard.

For example, when -qlanglvl=noc99preprocessor and -qwarn0x are specified, the C++11 preprocessor evaluates the controlling expressions in the #if and #elif conditional inclusion directives, and compare the evaluation results against that of the non-C++11 preprocessor. If they are different, the compiler issues the following warning message:
The preprocessor controlling expression evaluates differently between C++11
and non-C++11 langlvls.
For another example, when you specify both the -qlanglvl=noc99longlong and -qwarn0x options, the compiler might display messages to indicate that the types of an integer literal are different between the non-C++11 and C++11 language levels. In 32-bit mode, when you use the integer literal 2147483648 to initialize a variable, the compiler issues the following message:
Integral constant "2147483648" has implied type unsigned long int under 
the non-C++11 language levels. It has implied type long long int under C++11.
The compiler issues a similar message for the literal 10000000000000000000 with the same option setting:
Integral constant "10000000000000000000" has implied type unsigned long 
long or is not allowed with "-qlanglvl=extendedintegersafe" under C++11. 
Its implied type is not unsigned long long under non-C++11 language levels.
When the -qwarn0x option is enabled, for each occurrence of the following keywords, the compiler issues a warning message if the corresponding C++11 features and keywords are disabled.
  • constexpr
  • decltype
  • static_assert
For example, when the -qwarn0x option is enabled, if you specify both the -qlanglvl=nostatic_assert and -qnokeyword=static_assert options, the compiler treats static_assert as an identifier token and issues the following message for each static_assert identifier it encounters:
C++0x will reserve "static_assert" as a keyword whose C++0x feature can 
be enabled by -qlanglvl=static_assert.

Syntax

Read syntax diagramSkip visual syntax diagram
        .-nowarn0x-.   
>>- -q--+-warn0x---+-------------------------------------------><

Defaults

-qnowarn0x

Usage

This option is in effect when -qwarn0x is set.

Predefined macros

None.

Related information



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