Language level and your Standard C++ compliance objectives

Code that compiles without errors in pre-z/OS® C++ V1R2 compilers might produce warnings or error messages in the z/OS V2R2 XL C++ compiler. This could be due either to changes in the language or to differences in the compiler behavior. Language elements that may affect your code are shown in Changes that affect Standard C++ compliance of language features.

Table 1 shows the Standard C++ migration objectives and the recommended approach for each.
Note: Full conformance can be achieved gradually by migrating to selected individual language features in phases.
Table 1. Standard C++ migration objectives and approaches
Is code compliant with 1998 ISO Standard C++? Compliance objective Action
Yes (ported or new). Migrate to the 2003 Standard C++. No action required.
Remain compliant with 1998 Standard C++. Use one of the following compiler options and suboptions:
  • LANGLVL(ANSI)
  • LANGLVL(STRICT98)
Notes:
  1. LANGLVL(ANSI) and LANGLVL(STRICT98) are synonymous.
  2. You can use compiler options to control individual language features. See the "Compatability options for z/OS XL C/C++ compiler" table in the LANGLVL description, z/OS XL C/C++ User's Guide.
No Use Standard C++ language features, even if code must be modified. Use the following compiler options and suboptions to aid the migration process:
  • LANGLVL(COMPAT92) if your code compiles with a previous compiler and you want to move to z/OS V2R2 XL C/C++ with minimal changes.
    Note: This group is the closest you can get to the behavior of the previous compilers.
  • For information about compiler suboptions that you can use to control individual language features, refer to "Compatability options for z/OS(R) XL C/C++ compiler" in the LANGLVL compiler option description in z/OS XL C/C++ User's Guide.
Avoid modifying code and ignore Standard C++ language features. Use LANGLVL(COMPAT92) to tolerate language incompatibilities.