Setting the ANSI language level allows only language constructs that conform to ANSI C standards or, for C++ code, that conform to the standards in the ANSI working paper on C++ standards. All non-ANSI constructs cause compiler errors.
Use this language level to write code that is portable across ANSI-conforming systems. If your code is error-free at this level, it should be error-free with any other compiler.
Note: Because IBM C and C++ Compilers has a strict interpretation of the ANSI standard, it can find errors in code that compiles cleanly with other compilers. If you are porting code into IBM C and C++ Compilers, compile with the Extended language level.
Setting SAA Level 2 allows only language constructs that conform to SAA Level 2 C standards. This language level is valid for C code only, because there is no SAA standard for C++. SAA constructs include all those allowed under the ANSI language level, because the SAA C standard conforms to the ANSI standard. All non-SAA constructs cause compiler errors. This language level supports some additional library functions, and specifies some behaviors that are left as implementation-defined by the ANSI standard.
Use this language level to write code that is portable across SAA systems. If your code is error-free at this level, it should be error-free with any other IBM compiler.
Extended is the default language level.
The Extended language level allows all IBM C and C++ Compilers language constructs. These include all constructs that fall under the ANSI and SAA Level 2 language levels and the IBM C and C++ Compilers extensions to those standards.
This
level also allows certain Windows library functions.
Use the extended language level when you are creating code that does not need to be portable, or when you are porting code into IBM C and C++ Compilers from another compiler or platform.
The Compatible language level allows constructs and expressions that were allowed by earlier levels of the C++ language. This language level is valid for C++ code only.
When the language level is set to compatible:
delete [20] p;
20 is ignored.
Use this language level to write code that is portable to systems with older implementations of C++, or to port older code to the IBM C and C++ Compilers product.
![]()
Set the Source Code Language
Level
![]()
Summary of Compiler Options
Summary
of C Language Level Conflicts