In addition to the features supported by the various language standards, XL C/C++ contains language extensions that enhance usability and facilitate porting programs to different platforms.
We refer to the following language specifications as "base language levels" in order to introduce the notion of an extension to a base.
An orthogonal extension is a feature that is added on top of a base without altering the behavior of the existing language features. A valid program conforming to a base level will continue to compile and run correctly with such extensions. The program will still be valid, and its behavior will remain unchanged in the presence of the orthogonal extensions. Such an extension is therefore consistent with the corresponding base standard level. Invalid programs may behave differently at execution time and in the diagnostics issued by the compiler.
On the other hand, a non-orthogonal extension is one that can change the semantics of existing constructs or can introduce syntax conflicting with the base. A valid program conforming to the base is not guaranteed to compile and run correctly with the non-orthogonal extensions. Because of this, individual compiler options are provided to enable them.
Refer to XL C/C++ Compiler Reference for details about -qlanglvl and related compiler options for enabling the language extension features.
Certain language extensions that correspond to GNU C and C++ features are implemented to facilitate portability. These include both orthogonal and non-orthogonal extensions to C89, C99, and C++98. They are controlled by the -qlanglvl compiler option, as described in the previous section.
An example of an orthogonal extension related to GNU C is specifying the noreturn function attribute in a function declaration and definition. The compiler is informed that the function never returns, which may result in better performance, but any conforming program will not be affected by the feature. The semantics of the noreturn function attribute are deemed orthogonal.
An example of a non-orthogonal extension is the inline keyword. It is non-orthogonal because its current GNU C semantics are different from those of C99.
XL C/C++ implements non-orthogonal language features for handling AltiVec
vector types. These extensions support language features that exploit
the SIMD and parallel processing capabilities of the PowerPC processor, and
facilitate the associated optimization techniques.