LANGLVL

Category

Language element control

Pragma equivalent

#pragma langlvl (C only)

Purpose

Determines whether source code and compiler options should be checked for conformance to a specific language standard, or subset or superset of a standard.

Syntax

Category: Language element control for C

Read syntax diagramSkip visual syntax diagramLANG (,EXTENDEDCOMMONCEXTC89EXTC99EXTC1XSAASAAL2STDC89STDC99feature_suboption)

Category: Language element control for C++

Read syntax diagramSkip visual syntax diagramLANG (,EXTENDEDEXTENDED0XCOMPAT92STRICT98feature_suboption)

Defaults

LANGLVL(EXTENDED)

For the z/OS® UNIX System Services utilities, the defaults are as follows:
  • For the c99 command:
    • LANGLVL(STDC99)
  • For the c89 command:
    • LANGLVL(ANSI)
  • For the cc command:
    • LANGLVL(COMMONC)
  • For the c++ command:
    • LANGLVL(EXTENDED, NOLIBEXT, NOLONGLONG)
  • For the xlc command:
    • LANGLVL(EXTENDED)

Parameters

The following suboptions are only available under z/OS XL C:

COMMONC
It indicates language constructs that are defined by XPG, many of which LANGLVL(EXTENDED) already supports. LANGLVL(ANSI) and LANGLVL(EXTENDED) do not support the following, but LANGLVL(COMMONC) does:
  • Unsignedness is preserved for standard integral promotions (that is, unsigned char is promoted to unsigned int)
  • Trigraphs within literals are not processed
  • sizeof operator is permitted on bit fields
  • Bit fields other than int are tolerated, and a warning message is issued
  • Macro parameters within quotation marks are expanded
  • The empty comment in a subprogram-like macro is equivalent to the ANSI/ISO token concatenation operator
The macro __COMMONC__ is defined as 1 when you specify LANGLVL(COMMONC).
If you specify LANGLVL(COMMONC), the ANSIALIAS option is automatically turned off. If you want ANSIALIAS turned on, you must explicitly specify it.
Note: The option ANSIALIAS assumes code that supports Start of changeISO C/C++End of change. Using LANGLVL(COMMONC) and ANSIALIAS together may have undesirable effects on your code at a high optimization level. See ANSIALIAS | NOANSIALIAS for more information.
EXTC89
Indicates language constructs that are defined by the ISO C89 standard, plus additional orthogonal language extensions that do not alter the behavior of this standard.
Note: Under z/OS XL C, the unicode literals are enabled under the EXTC89 language level, and disabled under the strictly-conforming language levels. When the unicode literals are enabled, the macro __IBM_UTF_LITERAL is predefined to 1. Otherwise, this macro is not predefined.
EXTC99
Indicates language constructs that are defined by the ISO C99 standard, plus additional orthogonal language extensions that do not alter the behavior of the standard.
Note: Under z/OS XL C, the unicode literals are enabled under the EXTC99 language level, and disabled under the strictly-conforming language levels. When the unicode literals are enabled, the macro __IBM_UTF_LITERAL is predefined to 1. Otherwise, this macro is not predefined.
EXTC1X
Compilation is based on the C11 standard, invoking all the currently supported C11 features and other implementation-specific language extensions. For more information about the currently supported C11 features, see Extensions for C11 compatibility in z/OS XL C/C++ Language Reference.
Note: IBM® supports selected features of the C11 programming language standard. IBM continues to develop and implement the features of the new standard. The implementation of the language level is based on IBM's interpretation of the standard. Until IBM's implementation of all the features of the C11 standard is complete, including the support of a new C standard library, the implementation may 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 features of the C11 standard and therefore they should not be relied on as a stable programming interface.
SAA
Indicates language constructs that are defined by SAA.
SAAL2
Indicates language constructs that are defined by SAA Level 2.
STDC89
Indicates language constructs that are defined by the ISO C89 standard. This suboption is synonymous with LANGLVL(ANSI).
STDC99
Indicates language constructs that are defined by the ISO C99 standard.

The following suboptions are available under z/OS XL C and z/OS XL C++:

EXTENDED
It indicates all language constructs are available with z/OS XL C. It enables Start of changelanguageEnd of change extensions to the ISO C standard. The macro __EXTENDED__ is defined as 1.
Notes:
  • Start of changeSome of the latest ISO C standard library support might not be available. You can specify EXTC99 or EXTC1X to enable higher standard versions of the library.End of change
  • Under z/OS XL C, the unicode literals are enabled under the EXTENDED language level, and disabled under the strictly-conforming language levels. When the unicode literals are enabled, the macro __IBM_UTF_LITERAL is predefined to 1. Otherwise, this macro is not predefined.
ANSI
Use it if you are compiling new or ported code that is ISO C/C++ compliant. It indicates language constructs that are defined by ISO. Some non-Start of changeISO C/C++End of change stub routines will exist even if you specify LANGLVL(ANSI), for compatibility with previous releases. The macro __ANSI__ is defined as 1 for C only. It is intended to ensure that the compilation conforms to the ISO C and C++ standards.
Note: When you specify LANGLVL(ANSI), the compiler can still read and analyze the _Packed keyword in z/OS XL C/C++. If you want to make your code purely Start of changeISO C/C++End of change, you should redefine _Packed in a header file as follows:
#ifdef __ANSI__
  #define _Packed
#endif

The compiler will now see the _Packed attribute as a blank when LANGLVL(ANSI) is specified at compile time, and the language level of the code will be ANSI.

LIBEXT | NOLIBEXT
Specifying this option affects the headers provided by the C/C++ runtime library, which in turn control the availability of general ISO runtime extensions. In addition, it also defines the following macros and sets their values to 1: The default for C is LANG(LIBEXT) and for C++ is LANG(NOLIBEXT). However, LANG(LIBEXT) is implicitly enabled in C by LANG(COMMONC | SAA | SAAL2 | EXTENDED | EXTC89 | EXTC99) and in C++ by LANG(EXTENDED | COMPAT92).
LONGLONG | NOLONGLONG
This option controls the availability of pre-C99 long long integer types for your compilation. The default for C is LANG(LONGLONG) and for C++ is LANG(NOLONGLONG).
Note: This option does not take effect when the LANGLVL(C99LONGLONG) option is in effect, because the long long support provided by this option is incompatible with the semantics of the long long types mandated by the C99 standard as adopted in C++11.
TEXTAFTERENDIF | NOTEXTAFTERENDIF
Specifies whether to suppress the warning message that is emitted when you are porting code from a compiler that allows extra text after #endif or #else to the z/OS XL C/C++ compiler. The default option is LANGLVL(NOTEXTAFTERENDIF), indicating that a message is emitted if #else or #endif is followed by any extraneous text. However, when the language level is "classic", the default option is LANGLVL(TEXTAFTERENDIF), because this language level already allows extra text after #else or #endif without generating a message.

Predefined option groups are provided for commonly used settings for C++. These groups are:

LANGLVL(COMPAT92)
Use this option group if your code compiles with z/OS V1R1 and you want to move to z/OS V1R2 with minimal changes. This group is the closest you can get to the old behavior of the previous compilers.
LANGLVL(STRICT98) or LANGLVL(ANSI)
These two option groups are identical. Use them if you are compiling new or ported code that is ISO C++ compliant. They indicate language constructs that are defined by ISO. Some non-Start of changeISO C/C++End of change stub routines will exist even if you specify LANGLVL(ANSI), for compatibility with previous releases.
LANGLVL(EXTENDED)
This option group indicates all language constructs available with z/OS XL C++. It enables extensions to the ISO C/C++ standard. The macro __EXTENDED__ is defined as 1.
LANGLVL(EXTENDED0X)
This group option compiles code using all the C++ and currently supported C++11 features that are implemented in the XL C++ compiler.
Note: When multiple LANGLVL group options and suboptions are specified for one individual C++ feature, the last option specified on the command line takes precedence over any previous specifications.
The suboptions and their default settings for different language levels are listed in Table 1. The default setting On means that the suboption is enabled; otherwise, the default setting Off means that the suboption is disabled.
Table 1. Compatibility options for z/OS XL C++ compiler
Options Group names
compat92 strict98 / ansi extended extended0x
KEYWORD(bool) | NOKEYWORD(bool) Off On On On
KEYWORD(explicit) | NOKEYWORD(explicit) Off On On On
KEYWORD(export) | NOKEYWORD(export) Off On On On
KEYWORD(false) | NOKEYWORD(false) Off On On On
KEYWORD(mutable) | NOKEYWORD(mutable) Off On On On
KEYWORD(namespace) | NOKEYWORD(namespace) Off On On On
KEYWORD(true) | NOKEYWORD(true) Off On On On
KEYWORD(typename) | NOKEYWORD(typename) Off On On On
KEYWORD(using) | NOKEYWORD(using) Off On On On
LANGLVL(ANONSTRUCT | NOANONSTRUCT) Off Off On On
LANGLVL(ANONUNION | NOANONUNION) On Off On On
LANGLVL(ANSIFOR | NOANSIFOR) Off On On On
LANGLVL(ANSISINIT | NOANSISINIT) Off On On On
LANGLVL(AUTOTPYEDEDUCTION | NOAUTOTPYEDEDUCTION) Off Off Off On
LANGLVL(C1XNORETURN | NOC1XNORETURN) Off Off On On
LANGLVL(C99__FUNC__ | NOC99__FUNC__) Off Off On On
LANGLVL(C99COMPLEX | NOC99COMPLEX) Off Off Off Off
LANGLVL(C99COMPLEXHEADER | NOC99COMPLEXHEADER) Off Off Off Off
LANGLVL(C99LONGLONG | NOC99LONGLONG) Off Off Off On
LANGLVL(C99PREPROCESSOR | NOPREPROCESSOR) Off Off Off On
LANGLVL(C99VLA | NOC99VLA) Off Off On On
LANGLVL(COMPATRVALUEBINDING | NOCOMPATRVALUEBINDING) Off Off Off Off
LANGLVL(COMPLEXINIT | NOCOMPLEXINIT) Off Off On On
LANGLVL(CONSTEXPR | NOCONSTEXPR) Off Off Off On
LANGLVL(DECLTYPE | NODECLTYPE) Off Off Off On
LANGLVL(DEFAULTANDDELETE | NODEFAULTANDDELETE) Off Off Off On
LANGLVL(DELEGATINGCTORS | NODELEGATINGCTORS) Off Off Off On
LANGLVL(DEPENDENTBASELOOKUP | NODEPENDENTBASELOOKUP) On On On Off
LANGLVL(EMPTYSTRUCT | NOEMPTYSTRUCT) On Off On On
LANGLVL(EXPLICITCONVERSIONOPERATORS | NOEXPLICITCONVERSIONOPERATORS) Off Off Off On
LANGLVL(EXTENDEDFRIEND | NOEXTENDEDFRIEND) Off Off Off On
LANGLVL(EXTENDEDINTEGERSAFE | NOEXTENDEDINTEGERSAFE) Off Off Off Off
LANGLVL(EXTERNTEMPLATE | NOEXTERNTEMPLATE) Off Off On On
LANGLVL(GNU_COMPLEX | NOGNU_COMPLEX) Off Off Off Off
LANGLVL(GNU_COMPUTEDGOTO | NOGNU_COMPUTEDGOTO) Off Off On On
LANGLVL(GNU_INCLUDE_NEXT | NOGNU_INCLUDE_NEXT) On On On On
LANGLVL(GNU_LABELVALUE | NOGNU_LABELVALUE) Off Off On On
LANGLVL(GNU_SUFFIXIJ | NOGNU_SUFFIXIJ) Off Off On On
LANGLVL(ILLPTOM | NOILLPTOM) On Off On On
LANGLVL(IMPLICITINT | NOIMPLICITINT) On Off On On
LANGLVL(INLINENAMESPACE | NOINLINENAMESPACE) Off Off Off On
LANGLVL(LIBEXT | NOLIBEXT) On Off On On
LANGLVL(LONGLONG | NOLONGLONG) On Off On Off
LANGLVL(NULLPTR | NONULLPTR) Off Off Off On
LANGLVL(OFFSETNONPOD | NOOFFSETNONPOD) On Off On On
LANGLVL(OLDDIGRAPH | NOOLDDIGRAPH) Off On Off Off
LANGLVL(OLDFRIEND | NOOLDFRIEND) On Off On Off
LANGLVL(OLDMATH | NOOLDMATH) On Off Off Off
LANGLVL(OLDSTR | NOOLDSTR) On Off Off Off
LANGLVL(OLDTEMPACC | NOOLDTEMPACC) On Off On On
LANGLVL(OLDTMPLALIGN | NOOLDTMPLALIGN) On Off Off Off
LANGLVL(OLDTMPLSPEC | NOOLDTMPLSPEC) On Off On On
LANGLVL(REDEFMAC | NOREDEFMAC) Off Off Off Off
LANGLVL(REFERENCECOLLAPSING | NOREFERENCECOLLAPSING) Off Off Off On
LANGLVL(RIGHTANGLEBRACKET | NORIGHTANGLEBRACKET) Off Off Off On
LANGLVL(RVALUEREFERENCES | NORVALUEREFERENCES) Off Off Off On
LANGLVL(SCOPEDENUM | NOSCOPEDENUM) Off Off Off On
LANGLVL(STATIC_ASSERT | NOSTATIC_ASSERT) Off Off Off On
LANGLVL(TEMPSASLOCALS | NOTEMPSASLOCALS) Off Off Off Off
LANGLVL(TEXTAFTERENDIF | NOTEXTAFTERENDIF) Off Off Off Off
LANGLVL(TRAILENUM | NOTRAILENUM) On Off On On
LANGLVL(TYPEDEFCLASS | NOTYPEDEFCLASS) On Off On On
LANGLVL(VARIADICTEMPLATES | NOVARIADICTEMPLATES) Off Off Off On
LANGLVL(VARARGMACROS | NOVARARGMACROS) Off Off On On
LANGLVL(ZEROEXTARRAY | NOZEROEXTARRAY) Off Off On On
RTTI | NORTTI Off On On On
TMPLPARSE(NO | ERROR | WARN) NO WARN NO NO

The following suboptions are only available under z/OS XL C++:

ANONSTRUCT | NOANONSTRUCT
This option controls whether anonymous structs and anonymous classes are allowed in your C++ source. When LANG(ANONSTRUCT) is specified, z/OS XL C++ allows anonymous structs. This is an extension to the C++ standard.

Example: Anonymous structs typically are used in unions, as in the following code example:

union U {
   struct {
      int i:16;
      int j:16;
   };
   int k;
} u;
// ...
u.j=3;
When LANG(ANONSTRUCT) is in effect, you receive a warning if your code declares an anonymous struct. You can suppress the warning with SUPPRESS(CCN5017). When you build with LANG(NOANONSTRUCT) an anonymous struct is flagged as an error. Specify LANG(NOANONSTRUCT) for compliance with ISO standard C++. The default is LANG(ANONSTRUCT).
ANONUNION | NOANONUNION
This option controls what members are allowed in anonymous unions. When LANG(ANONUNION) is in effect, anonymous unions can have members of all types that ISO standard C++ allows in non-anonymous unions. For example, non-data members, such as structs, typedefs, and enumerations are allowed. Member functions, virtual functions, or objects of classes that have non-trivial default constructors, copy constructors, or destructors cannot be members of a union, regardless of the setting of this option. When LANG(ANONUNION) is in effect, z/OS XL C++ allows non-data members in anonymous unions. This is an extension to ISO standard C++. When LANG(ANONUNION) is in effect, you receive a warning if your code uses the extension, unless you suppress the message with SUPPRESS(CCN6608). Specify LANG(NOANONUNION) for compliance with ISO standard C++. The default is LANG(ANONUNION).
ANSIFOR | NOANSIFOR
This option controls whether scope rules defined in the C++ standard apply to names declared in for-init statements. By default, ISO standard C++ rules are used.

Example: The following code causes a name lookup error:

{
   //...
   for (int i=1; i<5; i++) {
      cout << i * 2 << endl;
   }
   i = 10;  // error
 }
The reason for the error is that i, or any name declared within a for-init-statement, is visible only within the for statement. To correct the error, either declare i outside the loop or specify LANG(NOANSIFOR). Specify LANG(NOANSIFOR) to allow old language behavior. The default is LANG(ANSIFOR).
ANSISINIT | NOANSISINIT
This suboption can be used to select between the old (prior to z/OS V1R1) and the current (z/OS V1R2 or later) compiler behaviors. It is useful for building an application that includes an existing DLL originally built with a z/OS V1R1 or earlier version of the z/OS XL C/C++ compilers. Specifying the NOANSISINIT suboption, will cause the behavior of global (including static locals) objects with destructors in the newly-compiled objects to be compatible with objects built with earlier compilers.

If you specify the LP64 option and the LANGLVL(NOANSISINIT) option, the compiler issues a warning, ignores the LANGLVL(NOANSISINIT) option and turns on the LANGLVL(ANSISINIT) option.

The default setting is LANGLVL(ANSISINIT).

Note: LANGLVL(EXTENDED) and LANVLVL(ANSI) set LANGLVL(ANSISINIT). LANGLVL(COMPAT92) sets LANGLVL(NOANSISINIT).
AUTOTYPEDEDUCTION | NOAUTOTYPEDEDUCTION
(C++11) This option controls whether the auto type deduction feature is enabled. When LANG(AUTOTYPEDEDUCTION) is in effect, you do not need to specify a type when declaring a variable. Instead, the compiler deduces the type of an auto variable from the type of its initializer expression.
You can also use the LANG(AUTOTYPEDEDUCTION) option to control the trailing return type feature. This feature is useful when declaring the following types of templates and functions:
  • Function templates or member functions of class templates with return types that depend on the types of the function arguments
  • Functions or member functions of classes with complicated return types
  • Perfect forwarding functions

When LANGLVL(AUTOTYPEDEDUCTION) is enabled, the macro __IBMCPP_AUTO_TYPEDEDUCTION is defined as 1; otherwise, the macro is undefined. In both cases, the macro is protected and a compiler warning is displayed if it is undefined or redefined.

LANGLVL(AUTOTYPEDEDUCTION) is implied in the group option of LANGLVL(EXTENDED0X). You can also use this group option to enable the auto type deduction feature.

The default is LANG(NOAUTOTYPEDEDUCTION).

C1XNORETURN | NOC1XNORETURN
This option controls whether the _Noreturn function specifier is supported.

When LANGLVL(C1XNORETURN) is enabled, the macro __IBMC_NORETURN is defined as 1.

LANGLVL(C1XNORETURN) is implied in group options LANGLVL(EXTENDED0X) and LANGLVL(EXTENDED). You can also use these group options to enable the function specifier.

The default is LANG(NOC1XNORETURN).

C99__FUNC__ | NOC99__FUNC__
This option provides an alternative method for debugging programs by identifying the names of functions where the __func__ identifier is used.
C99COMPLEX|NOC99COMPLEX
This option controls whether C99 complex data types and related keywords are enabled. The default is LANG(NOC99COMPLEX).
C99COMPLEXHEADER|NOC99COMPLEXHEADER
This option controls whether the C99 complex.h header file is used. The default is LANG(NOC99COMPLEXHEADER).
C99LONGLONG | NOC99LONGLONG
(C++11) This option controls whether the feature of C99 long long with IBM extensions adopted in C++11 is enabled. When LANG(C99LONGLONG) is in effect, the C++ compiler provides the C99 long long with IBM extensions feature. Source compatibility between the C and the C++ language is improved. The default is LANG(NOC99LONGLONG).

The C99LONGLONG option conflicts with the LONGLONG option. If you specify both options, the LONGLONG option is ignored.

Notes:
  1. When LANGLVL(C99LONGLONG) is enabled, the __IBMCPP_C99_LONG_LONG macro is defined as 1; otherwise, the macro is undefined. In both cases, the macro is protected and a compiler warning is displayed if it is undefined or redefined.
  2. LANGLVL(C99LONGLONG) is implied in the group option of LANGLVL(EXTENDED0X). You can also use this group option to enable the feature of C99 long long with IBM extensions adopted in C++11.
C99PREPROCESSOR | NOC99PREPROCESSOR
(C++11) This option controls whether the C99 preprocessor features adopted in C++11 are enabled. When LANG(C99PREPROCESSOR) is in effect, C99 and C++11 compilers provide a common preprocessor interface, which can ease the porting of C source files to the C++ compiler and avoid preprocessor compatibility issues. The default is LANG(NOC99PREPROCESSOR).
Notes:
  1. When LANGLVL(C99PREPROCESSOR) is enabled, the __IBMCPP_C99_PREPROCESSOR macro is defined as 1; otherwise, the macro is undefined. In both cases, the macro is protected and a compiler warning is displayed if it is undefined or redefined.
  2. LANGLVL(C99PREPROCESSOR) is implied in group option LANGLVL(EXTENDED0X). You can also use this group option to enable the C99 preprocessor features adopted in C++11.
C99VLA | NOC99VLA
This option controls variable length arrays. The default is LANG(C99VLA).
CHECKPLACEMENTNEW | NOCHECKPLACEMENTNEW
This option controls whether a null pointer check is performed on the pointer that is returned by an invocation of the reserved forms of the placement operator new and operator new[]. This is especially beneficial if the calls to placement operator new and operator new[] are inside loops or in functions which are called frequently. In those cases, using the LANGLVL(NOCHECKPLACEMENTNEW) option might increase the runtime performance of your application. The default is LANGLVL(CHECKPLACEMENTNEW).

This option is independent from option RTCHECK(NULLPTR). For more information about placement new, see Placement syntax in z/OS XL C/C++ Language Reference.

COMPATRVALUEBINDING | NOCOMPATRVALUEBINDING
The C++ Standard (2003) indicates that an rvalue can only be bound to a const reference. Non-compliant compilers might allow a non-const reference to be bound to an rvalue. When you are porting code to the z/OS XL C/C++ compiler, you can specify this option to instruct the compiler to allow a non-const reference to bind to an rvalue of a user-defined type where an initializer is not required. The default is LANGLVL(NOCOMPATRVALUEBINDING). For more information, see Binding an rvalue to a non-const reference in z/OS XL C/C++ Language Reference.
COMPLEXINIT | NOCOMPLEXINIT
This option controls whether the initialization of complex types is enabled.

LANGLVL(COMPLEXINIT) is implied in group options LANGLVL(EXTENDED) and LANGLVL(EXTENDED0X), so you can also use these group options to enable the initialization of complex types.

CONSTEXPR | NOCONSTEXPR
(C++11) Controls whether the generalized constant expressions feature is enabled. When you specify the LANGLVL(CONSTEXPR) option, the compiler extends the expressions permitted within constant expressions. A constant expression is one that can be evaluated at compile time. The default option is LANGLVL(NOCONSTEXPR).
Notes:
  1. When the generalized constant expressions feature is enabled, the __IBMCPP_CONSTEXPR macro is defined as 1; otherwise, the macro is undefined. In both cases, the macro is protected and a compiler warning is displayed if it is undefined or redefined.
  2. The LANGLVL(CONSTEXPR) is implied in the group option of LANGLVL(EXTENDED0X). You can also use this group option to enable the declaration type feature.
DBCS | NODBCS
This option controls whether multi-byte characters are accepted in string literals and in comments. The default is LANG(NODBCS).
DECLTYPE | NODECLTYPE
(C++11) This option controls whether the decltype specifier is enabled. When LANG(DECLTYPE) is in effect, decltype can be used on an expression to get the resultant type of that expression, which might be type dependent. The default is LANG(NODECLTYPE).
Notes:
  1. When support for the decltype specifier is enabled, the __IBMCPP_DECLTYPE macro is defined as 1; otherwise, the macro is undefined. In both cases, the macro is protected and a compiler warning is displayed if it is undefined or redefined.
  2. LANGLVL(DECLTYPE) is implied in the group option of LANGLVL(EXTENDED0X). You can also use this group option to enable the declaration type feature.
DEFAULTANDDELETE | NODEFAULTANDDELETE
(C++11) Controls whether the defaulted and deleted functions feature is enabled. With this feature, you can define explicitly defaulted functions whose implementations are generated by the compiler to achieve higher efficiency. You can also define deleted functions whose usages are disabled by the compiler to avoid calling unwanted functions. LANGLVL(DEFAULTANDDELETE) is implied in the group option of LANGLVL(EXTENDED0X). You can also use this group option to enable the delegating constructors feature. The default is LANGLVL(NODEFAULTANDDELETE).
DELEGATINGCTORS | NODELEGATINGCTORS
(C++11) This option controls whether the delegating constructors feature is enabled. When LANG(DELEGATINGCTORS) is specified, you can concentrate common initializations and post initializations in one constructor, which improves the readability and maintainability of the program. The default is LANG(NODELEGATINGCTORS).
Notes:
  1. When the delegating constructors feature is enabled, the __IBMCPP_DELEGATING_CTORS macro is defined as 1; otherwise, the macro is undefined. In both cases, the macro is protected and a compiler warning is displayed if it is undefined or redefined.
  2. LANGLVL(DELEGATINGCTORS) is implied in the group option of LANGLVL(EXTENDED0X). You can also use this group option to enable the delegating constructors feature.
DEPENDENTBASELOOKUP | NODEPENDENTBASELOOKUP
This option controls whether to apply the name lookup rules for a template base class of dependent type, which is defined in the Technical Corrigendum 1 (TC1) of the C++ Standard. Specify LANG(NODEPENDENTBASELOOKUP) for compliance with TC1. When LANG(NODEPENDENTBASELOOKUP) is in effect, unqualified names in a template class will not be resolved in a base class if that base class is dependent on a template parameter. These names must be qualified with the base class name in order to be found by name lookup.
The following example shows code that does not compile with LANG(NODEPENDENTBASELOOKUP):
struct base 
{
          int baseName;
};

template <class B> struct derived : public B
{    
   void func()
    {
    int i = baseName;     // this name will not be found in the base class
    }; 
};

int main(void)
{    
   derived<base> x;
   x.func();    
   return 0;
}
The following example produces the same compiler result whether LANG(NODEPENDENTBASELOOKUP) is used or not:
struct base 
{
          int baseName;
};

template <class B> struct derived : public B
{    
   void func()
    {
    int i = B::baseName;   // qualified name will be found in the base class
    }; 
};

int main(void)
{    
   derived<base> x;
   x.func();    
   return 0;
}
The default is LANG(DEPENDENTBASELOOKUP). When the default option is in effect, the behavior of previous XL C++ compilers remains.
DOLLARINNAMES | NODOLLARINNAMES
This option controls whether the dollar-sign character ($) is allowed in identifiers. If LANG(NODOLLARINNAMES) is in effect, dollar sign characters in identifiers are treated as syntax errors. The default is LANG(NODOLLARINNAMES).
Note: In the z/OS UNIX System Services environment, LANG(DOLLARINNAMES) must be specified by using the -qdollar option with the xlc command. The -qdollar option allows the dollar-sign ($) symbol to be used in the names of identifiers.
EMPTYSTRUCT | NOEMPTYSTRUCT
This option instructs the compiler to tolerate empty member declarations in structs. ISO C++ does not permit empty member declaration in structs.
Example: When LANG(NOEMPTYSTRUCT) is in effect , the following example will be rejected by the compiler:
struct S {
      ;  // this line is ill-formed
};
The default is LANG(NOEMPTYSTRUCT).
EXTENDED0X
(C++11) Compilation is based on the C++11 standard, invoking most of the C++ features and all the currently-supported C++11 features.
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 may 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.

Under z/OS XL C++, the unicode literals and character types are enabled under the EXTENDED and EXTENDED0X language levels, and disabled under the other language levels. When the unicode literals are enabled, the macros __IBM_UTF_LITERAL and __IBMCPP_UTF_LITERAL__ are predefined to 1. Otherwise, they are not predefined. Under the EXTENDED0X language level, the keywords char16_t and char32_t are enabled by default.

EXPLICITCONVERSIONOPERATORS | NOEXPLICITCONVERSIONOPERATORS
(C++11) Controls whether the explicit conversion operators feature is enabled. When you specify the LANGLVL(EXPLICITCONVERSIONOPERATORS) option, you can apply the explicit function specifier to the definition of a user-defined conversion function, and thus to inhibit unintended implicit conversions through the user-defined conversion function.

The LANGLVL(EXPLICITCONVERSIONOPERATORS) option is included in the group option LANGLVL(EXTENDED0X), so you can also use this group option to enable the explicit conversion operators feature.

The default is LANG(NOEXPLICITCONVERSIONOPERATORS).

EXTENDEDFRIEND | NOEXTENDEDFRIEND
(C++11) This option controls whether C++98 or C++11 friend declarations are used. With this option, you can name template parameters and typedef names as friends. Basic types can also be used in friend declarations in the C++11 standard. The class keyword in the context for friend declarations is removed in the C++11 standard, which differs from the C++98 friend class declaration syntax where the class keyword is necessary. This greatly improves the generality of templates and friend declarations. The default is LANG(NOEXTENDEDFRIEND).

The LANGLVL(EXTENDEDFRIEND) option is incompatible with the LANGLVL(OLDFRIEND) compiler option. When LANGLVL(EXTENDEDFRIEND) is in effect, the LANGLVL(OLDFRIEND) option is ignored and its setting is LANGLVL(NOOLDFRIEND).

Notes:
  1. If either LANGLVL(EXTENDED0X) or LANGLVL(EXTENDEDFRIEND) is in effect, the __IBMCPP_EXTENDED_FRIEND macro will be defined to 1; otherwise, it is undefined.
  2. LANGLVL(EXTENDEDFRIEND) is implied in the group option LANGLVL( EXTENDED0X). You can also use this group option to enable the C++98 or C++11 friend declarations.
EXTENDEDINTEGERSAFE | NOEXTENDEDINTEGERSAFE
(C++11) IBM With this option, if a decimal integer literal does not have a suffix containing u or U and it cannot be represented by the long long int type, you can decide whether to use the unsigned long long int to represent the literal. The default is LANG(NOEXTENDEDINTEGERSAFE).

This option takes effect only when the LANG(C99LONGLONG) option is specified. Otherwise, the compiler issues a warning message to indicate that the option is ignored. When you specify both LANG(C99LONGLONG) and LANG(EXTENDEDINTEGERSAFE), if a decimal integer literal does not have a suffix containing u or U and it cannot be represented by the long long int type, the compiler issues an error message stating that the value of the literal is out of range.

EXTERNTEMPLATE | NOEXTERNTEMPLATE
(C++11) This option controls whether the feature for supporting explicit instantiation declarations is enabled. With this feature, you can suppress the implicit instantiations of a template specialization or its members. This feature can be enabled by LANG(EXTERNTEMPLATE), which is the default.
Notes:
  1. When explicit instantiation declaration is enabled, the compiler defines the __IBMCPP_EXTERN_TEMPLATE macro as 1; otherwise, the macro is undefined. In both cases, the macro is protected. When the macro is undefined or redefined, the compiler issues a warning.
  2. LANGLVL(EXTERNTEMPLATE) is implied in the group options of LANGLVL(EXTENDED) and LANGLVL(EXTENDED0X). You can also use the group options to enable the explicit instantiation declarations.
GNU_COMPLEX | NOGNU_COMPLEX
This option controls whether GNU complex data types and related keywords are enabled. The default is LANG(NOGNU_COMPLEX).
GNU_COMPUTEDGOTO | NOGNU_COMPUTEDGOTO
This option controls whether support for computed goto statements is enabled.
GNU_INCLUDE_NEXT | NOGNU_INCLUDE_NEXT
This option is provided as a GNU C++ portability option to enable or disable support for the GNU #include_next preprocessor directive. The default is LANG(GNU_INCLUDE_NEXT).
GNU_LABELVALUE | NOGNU_LABELVALUE
This option controls whether support for labels as values is enabled.
GNU_SUFFIXIJ | NOGNU_SUFFIXIJ
This option controls whether support for GNU-style complex numbers is enabled.
ILLPTOM | NOILLPTOM
This controls what expressions can be used to form pointers to members. The compiler accepts some forms that are in common use, but do not conform to the C++ standard. When LANG(ILLPTOM) is in effect, the compiler allows these forms.
Example: The following code defines the pointer to a function member, p, and initializes the address of C::foo, in the old style:
struct C {
void foo(init);
};

void (C::*p) (int) = C::foo;
Specify LANG(NOILLPTOM) for compliance with the C++ standard.
Example: The example must be modified to use the & operator:
struct C {
void foo(int);
};

void (C::*p) (int) = &C::foo;
The default is LANG(ILLPTOM).
IMPLICITINT | NOIMPLICITINT
This option controls whether z/OS XL C++ will accept missing or partially specified types as implicitly specifying int. This is no longer accepted in the standard but may exist in legacy code. When LANG(NOIMPLICITINT) is specified, all types must be fully specified. Also, when LANG(IMPLICITINT) is specified, a function declaration at namespace scope or in a member list will implicitly be declared to return int. Also, any declaration specifier sequence that does not completely specify a type will implicitly specify an integer type. Note that the effect is as if the int specifier were present. This means that the specifier const, by itself, would specify a constant integer. The following specifiers do not completely specify a type:
  • auto
  • const
  • extern
  • extern "<literal>"
  • inline
  • mutable
  • friend
  • register
  • static
  • typedef
  • virtual
  • volatile
  • platform specific types (for example, _cdecl, __declspec)
Note that any situation where a type is specified is affected by this option. This includes, for example, template and parameter types, exception specifications, types in expressions (eg, casts, dynamic_cast, new), and types for conversion functions. By default, LANG(EXTENDED) sets LANG(IMPLICITINT). This is an extension to the C++ standard.
Example: The return type of function MyFunction is int because it was omitted in the following code:
MyFunction()
{
   return 0;
}
Specify LANG(NOIMPLICITINT) for compliance with ISO standard C++.
Example: The function declaration must be modified to:
int MyFunction()
{
   return 0;
}
The default is LANG(IMPLICITINT).
INLINENAMESPACE | NOINLINENAMESPACE
(C++11) This option controls whether the inline namespace definition feature is enabled. A namespace definition preceded by an initial inline keyword is defined as an inline namespace. Members of the inline namespace can be defined and specialized as if they were also members of the enclosing namespace. The default is LANG(NOINLINENAMESPACE).
Notes:
  1. When LANGLVL(INLINENAMESPACE) is enabled, the __IBMCPP_INLINE_NAMESPACE macro is defined as 1; otherwise, the macro is undefined. In both cases, the macro is protected and a compiler warning is displayed if it is undefined or redefined.
  2. LANGLVL(INLINENAMESPACE) is implied in the group option of LANGLVL(EXTENDED0X). You can also use this group option to enable the inline namespace definitions.
NEWEXCP | NONEWEXCP
This option determines whether or not the C++ operator new throws an exception. When LANGLVL(NEWEXCP) is specified, the standard exception std::bad_alloc is thrown when the requested memory allocation fails. This option does not apply to the nothrow versions of the new operator. The default setting is NONEWEXCP. This option governs the behavior of the default versions of the standard new operators. This option does apply to the throw versions of the new operator except for class-specific new operators, user-defined new operators, and new operators with placement arguments.
NULLPTR | NONULLPTR
Controls whether the nullptr feature is enabled. A null pointer with the nullptr value can be converted to any pointer type, pointer-to-member type, or bool type. The nullptr constant can be distinguished from the integer 0 for overloaded functions. The LANGLVL(NULLPTR) option is included in the group option LANGLVL(EXTENDED0X). You can also use this group option to enable the nullptr keyword feature. The default option is LANGLVL(NONULLPTR).
OFFSETNONPOD | NOOFFSETNONPOD
This option controls whether the offsetof macro can be applied to classes that are not data-only. C++ programmers often casually call data-only classes "Plain Old Data" (POD) classes. By default, LANG(EXTENDED) allows offsetof to be used with non-POD classes. This is an extension to the C++ standard. When LANG(OFFSETNONPOD) is in effect , you receive a warning if your code uses the extension, unless you suppress the message with SUPPRESS(CCN6281). Specify LANG(NOOFFSETNONPOD) for compliance with ISO standard C++. Specify LANG(OFFSETNONPOD) if your code applies offsetof to a class that contains one of the following:
  • User-declared constructors or destructors
  • User-declared assignment operators
  • Private or protected non-static data members
  • Base classes
  • Virtual functions
  • Non-static data members of type pointer to member
  • A struct or union that has non-data members
  • References
The default is LANG(OFFSETNONPOD).
OLDDIGRAPH | NOOLDDIGRAPH
This option controls whether old-style digraphs are allowed in your C++ source. It applies only when DIGRAPH is also set. When LANG(NOOLDDIGRAPH) is specified, z/OS XL C++ supports only the digraphs specified in the C++ standard. Set LANG(OLDDIGRAPH) if your code contains at least one of following digraphs:
  • digraph, which results in # (pound sign)
  • digraph, which results in ## (double pound sign, used as the preprocessor macro concatenation operator)
Specify LANG(NOOLDDIGRAPH) for compatibility with ISO standard C++ and the extended C++ language level. The default is LANG(NOOLDDIGRAPH).
OLDFRIEND | NOOLDFRIEND
This option controls whether friend declarations that name classes without elaborated class names are treated as C++ errors. When LANG(OLDFRIEND) is in effect, you can declare a friend class without elaborating the name of the class with the keyword class. This is an extension to the C++ standard. For example, this statement declares the class IFont to be a friend class and is valid when LANG(OLDFRIEND) is in effect:
friend IFont;
This example declaration causes a warning unless you modify it or suppress the message with the SUPPRESS(CCN5070) option. Specify LANG(NOOLDFRIEND) for compliance with ISO standard C++. Specifying this option will cause an error condition and message to be generated for the example declaration.
friend class IFont;
The default for batch and TSO is LANG(OLDFRIEND).
OLDMATH | NOOLDMATH
This option controls which math function declarations are introduced by the math.h header file. For conformance with the C++ standard, the math.h header file declares several new functions that were not declared by math.h in previous releases. These new function declarations may cause an existing program to become invalid and, therefore, to fail to compile. This occurs because the new function declarations introduce the possibility of ambiguities in function overload resolution. The OLDMATH option specifies that these new function declarations are not to be introduced by the math.h header file, thereby significantly reducing the possibility of ambiguous overload resolution. The default is LANG(NOOLDMATH).
OLDSTR | NOOLDSTR
This option provides compatibility with earlier versions of z/OS XL C++ and predecessor products, by controlling which string function declarations are introduced by the string.h and wchar.h header files. For conformance with the current C++ standard, string.h and the wchar.h header files declare several C++ string functions differently for C++ source files than they were declared in previous releases. These new function declarations may cause an existing C++ program to become invalid and therefore fail to compile. The LANG(OLDSTR) option specifies that the new C++ string function declarations are not to be introduced by the string.h and wchar.h header files, thereby causing only the C versions of these functions to be declared, as in previous releases. Note that when a C source file is compiled, these declarations remain unchanged from previous releases.

A number of the string function signatures that are defined in the 1989 C International Standard and the C Amendment are not const-safe.

Example: Consider the following standard C signature:
char * strchr(const char *s, int c);

The behavior of this function is specified as follows:

  • The strchr function locates the first occurrence of c (converted to a char) in the string pointed to by s. The terminating null character is considered to be part of the string.
  • The strchr function returns a pointer to the located character, or a null pointer if the character does not occur in the string.

Since the parameter s is of type const char *s, the string being searched by the strchr function is potentially composed of characters whose type is const char. The strchr function returns a pointer to one of the constituent characters of the string, but this pointer is of type char * even though the character that it points to is potentially of type const char. For this reason, strchr can be used to implicitly (and unintentionally) defeat the const-qualification of the string referenced by the pointer s.

Example: To correct this problem, the C++ standard replaces the signature from the C standard with the following overloaded signatures:
const char * strchr(const char *s, int c);
      char * strchr(      char *s, int c);

Both of these overloaded functions have the same behavior as the original C version of strchr.

In a similar manner, the signatures of several other standard C library routines are replaced in the C++ standard. The affected routines are:

  • strchr
  • strpbrk
  • strrchr
  • strstr
  • memchr
  • wcschr
  • wcspbrk
  • wcsrchr
  • wcsstr
  • wmemchr
Example: Because of the changes mandated by the C++ standard, the following unsafe example will not compile in C++:
        #include <string.h>

        const char s[] = "foobar";

        int main(void) {
                char * c = strchr(s, 'b');
        }

To preserve compatibility with earlier releases (and thus enable this code example), specify LANGLVL(OLDSTR).

OLDTEMPACC | NOOLDTEMPACC
This option controls whether access to a copy constructor to create a temporary object is always checked, even if creation of the temporary object is avoided. When LANG(NOOLDTEMPACC) is in effect, z/OS XL C++ suppresses the access checking. This is an extension to the C++ standard. When LANG(OLDTEMPACC) is in effect, you receive a warning if your code uses the extension, unless you disable the message. Disable the message by building with SUPPRESS(CCN5306) when the copy constructor is a private member, and SUPPRESS(CCN5307) when the copy constructor is a protected member. Specify LANG(NOOLDTEMPACC) for compliance with ISO standard C++.
Example: The throw statement in the following code causes an error because the copy constructor is a protected member of class C:
class C {
public:
   C(char *);
protected:
   C(const C&);
};

C foo() {return C("test");}  // returns a copy of a C object 

void f()
{
// catch and throw both make implicit copies of the thrown object
   throw C("error");         // throws a copy of a C object
   const C& r = foo();       // uses the copy of a C object created by foo()
}
This example code contains three ill formed uses of the copy constructor C(const C&). The default is LANG(OLDTEMPACC).
OLDTMPLALIGN | NOOLDTMPLALIGN
This option specifies the alignment rules implemented by the compiler for nested templates. Previous versions of the compiler ignored alignment rules specified for nested templates. By default, LANG(EXTENDED) sets LANG(NOOLDTMPLALIGN) so the alignment rules are not ignored. The default for is LANG(NOOLDTMPLALIGN).
OLDTMPLSPEC | NOOLDTMPLSPEC
This option controls whether template specializations that do not conform to the C++ standard are allowed. When LANG(OLDTMPLSPEC) is in effect, z/OS XL C++ allows these old specializations. This is an extension to ISO standard C++. When LANGLVL(OLDTMPLSPEC) is set, you receive a warning if your code uses the extension, unless you suppress the message with SUPPRESS(CCN5080).
Example: You can explicitly specialize the template class ribbon for type char with the following lines:
template<classT> class ribbon { /*...*/};
class ribbon<char> { /*...*/};
Specify LANG(NOOLDTMPLSPEC) for compliance with standard C++. In this example, the template specialization must be modified to:
template<class T> class ribbon { /*...*/};
template<> class ribbon<char> { /*...*/};
The default is LANG(OLDTMPLSPEC).
REDEFMAC | NOREDEFMAC
Controls whether a macro can be redefined without a prior #undef or undefine() statement.
REFERENCECOLLAPSING | NOREFERENCECOLLAPSING
(C++11) Controls whether the reference collapsing feature is enabled. To enable this feature, specify the LANGLVL(REFERENCECOLLAPSING) option.

The LANGLVL(REFERENCECOLLAPSING) option is included in the group option LANGLVL(EXTENDED0X), so you can also use this group option to enable the reference collapsing feature.

When the LANGLVL(RVALUEREFERENCES) option is in effect, but the LANGLVL(REFERENCECOLLAPSING) option is not in effect, the compiler behaves as if the LANGLVL(REFERENCECOLLAPSING) option were specified.

The default option is LANGLVL(NOREFERENCECOLLAPSING).

RIGHTANGLEBRACKET | NORIGHTANGLEBRACKET
(C++11) Controls whether the right angle bracket feature is enabled. To enable this feature, you can specify the LANGLVL(RIGHTANGLEBRACKET) option.

The LANGLVL(RIGHTANGLEBRACKET) option is included in the group option LANGLVL(EXTENDED0X), so you can also use this group option to enable the right angle bracket feature.

The default option is LANGLVL(NORIGHTANGLEBRACKET).

RVALUEREFERENCES | NORVALUEREFERENCES
(C++11) Controls whether the rvalue references feature is enabled. To enable this feature, specify the LANGLVL(RVALUEREFERENCES) option.

The LANGLVL(RVALUEREFERENCES) option is included in the group option LANGLVL(EXTENDED0X), so you can also use this group option to enable the rvalue references feature.

If both the LANGLVL(COMPATRVALUEBINDING) and LANGLVL(RVALUEREFERENCES) options are in effect, the compiler issues an error message.

The default option is LANGLVL(NORVALUEREFERENCES).

SCOPEDENUM | NOSCOPEDENUM
(C++11) Controls whether the scoped enumeration feature is enabled. To enable this feature, you can specify the LANGLVL(SCOPEDENUM) option.

The LANGLVL(SCOPEDENUM) option is included in the group option LANGLVL(EXTENDED0X), so you can also use this group option to enable the scoped enumeration feature.

The default option is LANGLVL(NOSCOPEDENUM).

STATIC_ASSERT | NOSTATIC_ASSERT
(C++11) This option controls whether the static assertions feature is enabled. When LANGLVL(STATIC_ASSERT) is set, a severe error message for compile-time assertions is issued on failure. The default is LANG(NOSTATIC_ASSERT).
Notes:
  1. When the static assertions feature is enabled, the __IBMCPP_STATIC_ASSERT macro is defined to 1; otherwise, the macro is undefined. In both cases, the macro is reserved by the compiler and a warning or an error is displayed if it is undefined or redefined.
  2. LANGLVL(STATIC_ASSERT) is implied in the group option of LANGLVL(EXTENDED0X). You can also use this group option to enable the static assertions feature.
TEMPSASLOCALS | NOTEMPSASLOCALS
When you are porting an application from a compiler that implements late temporary destruction, you might need to extend the lifetime of C++ temporaries beyond which is specified in the C++ Language Standard. This option extends the lifetime of temporaries to reduce migration difficulty.
For details, see Lifetime of C++ temporaries (C++ only) in z/OS XL C/C++ Language Reference.
TRAILENUM | NOTRAILENUM
This option controls whether trailing commas are allowed in enum declarations. When LANG(TRAILENUM) is in effect, z/OS XL C++ allows one or more trailing commas at the end of the enumerator list. This is an extension to the C++ standard. The following enum declaration uses this extension:
enum grain { wheat, barley, rye,, };
Specify LANG(NOTRAILENUM) for compliance with the ISO C and C++ standards. The default is LANG(TRAILENUM).
TYPEDEFCLASS | NOTYPEDEFCLASS
This option provides compatibility with earlier versions of z/OS XL C++ and predecessor products. The current C++ standard does not allow a typedef name to be specified where a class name is expected. This option relaxes that restriction. Specify LANG(TYPEDEFCLASS) to allow the use of typedef names in base specifiers and constructor initializer lists. When LANG(NOTYPEDEFCLASS) is in effect, a typedef name cannot be specified where a class name is expected. The default is LANG(TYPEDEFCLASS).
UCS | NOUCS
This option controls whether Unicode characters are allowed in identifiers, string literals and character literals in C++ source code. The Unicode character set is supported by the C++ standard. This character set contains the full set of letters, digits and other characters used by a wide range of languages, including all North American and Western European languages. Unicode characters can be 16 or 32 bits. The ASCII one-byte characters are a subset of the Unicode character set. When LANG(UCS) is in effect, you can insert Unicode characters in your source files either directly or using a notation that is similar to escape sequences. Because many Unicode characters cannot be displayed on the screen or entered from the keyboard, the latter approach is usually preferred. Notation forms for Unicode characters are \uhhhh for 16-bit characters, or \Uhhhhhhhh for 32-bit characters, where h represents a hexadecimal digit. Short identifiers of characters are specified by ISO/IEC 10646. The default is LANG(NOUCS).
Note: The C99 specification has added the use of universal character names within identifiers and the set of restrictions differs from C++. LANG(UCS) supports the union of valid universal character name ranges from the current C++ specification and the new C99 specification.
VARIADICTEMPLATES | NOVARIADICTEMPLATES
(C++11) This option controls whether the variadic templates feature is enabled. When LANGLVL(VARIADICTEMPLATES) is set, you can define class and function templates that have any number (including zero) of parameters. The default is LANG(NOVARIADICTEMPLATES).
Notes:
  1. When the variadic templates feature is enabled, the __IBMCPP_VARIADIC_TEMPLATES macro is defined to 1; otherwise, the macro is undefined. In both cases, the macro is reserved by the compiler and a warning or an error is displayed if it is undefined or redefined.
  2. LANGLVL(VARIADICTEMPLATES) is implied in the group option of LANGLVL(EXTENDED0X). You can also use this group option to enable the variadic templates feature.
VARARGMACROS | NOVARARGMACROS
This option enables or disables support for C99-style variable argument lists in function-like macros.
ZEROEXTARRAY | NOZEROEXTARRAY
IBM This option controls whether zero-extent arrays are allowed as the last nonstatic data member in a structure definition. When LANG(ZEROEXTARRAY) is in effect, z/OS XL C++ compiler allows arrays with zero elements. This is an extension to the C++ standard.
Example: The following statement declares a zero-extent array a:
struct S1 { char a[0]; };
Specify LANG(NOZEROEXTARRAY) for compliance with the ISO C++ standard. When LANG(ZEROEXTARRAY) is set, you receive informational messages about zero-extent arrays in your code, unless you suppress the message with SUPPRESS(CCN6607). The default is LANG(ZEROEXTARRAY).

Usage

The LANGLVL option defines a macro that specifies a language level. You must then include this macro in your code to force conditional compilation; for example, with the use of #ifdef directives. You can write portable code if you correctly code the different parts of your program according to the language level. You use the macro in preprocessor directives in header files.

Note: The following list shows ISO C99 language constructs unavailable with LANGLVL(EXTENDED) or LANGLVL(EXTC89):
  • inline keyword
  • restrict keyword
  • C++ style comments
Unsuffixed integer literals are handled differently under ISO C99 than they are for LANGLVL(EXTENDED) or LANGLVL(EXTC89). Unsuffixed integer literals with values greater than INT_MAX, have a long long type under ISO C99 and an unsigned int type under LANGVL(EXTENDED) or LANGLVL(EXTC89).
You can control individual language features in the z/OS V1R2 C++ compiler by using the LANGLVL and KEYWORD suboptions listed in Table 1. In order to conform to the ISO C++ standard, you may need to make a number of changes to your existing source code. These suboptions can help by breaking up the changes into smaller steps.
Note: The group options override the individual suboptions so if you want to specify a suboption it should be after a group option. For example, if you specify LANG(ANSIFOR,COMPAT92) you will get LANG(NOANSIFOR) because the LANG(COMPAT92) specifies NOANSIFOR. Thus you should specify LANG(COMPAT92,ANSIFOR) to get ANSIFOR.

The usage status of this option is inserted in the object file to aid you in diagnosing a problem with your program.

Predefined macros

For the list of predefined macros related to language levels, see Macros related to language levels in z/OS XL C/C++ Language Reference.