Language levels and language extensions

The C language described in this reference is based on the standards listed in Standards and specifications.

We refer to the following language specifications as "base language levels" in order to introduce the notion of an extension to a base.
  • C99
  • C89

This information uses the term K&R C to refer to the C language plus the generally accepted extensions produced by Brian Kernighan and Dennis Ritchie that were in use prior to the ISO standardization of C.

In addition to the features supported by the base levels, XL C contains language extensions that enhance usability and facilitate porting programs to different platforms, including:
You can control the language level to be used for compilation through several mechanisms, including:

With a few exceptions, almost all of the language extensions are supported when you compile using the basic invocation command xlc.

The default language level for the xlc invocation command is extc99, which includes all of the features introduced by the C99 standard, and most of the IBM extensions described in this information. For a complete listing of the C extensions and various methods for enabling them, see The IBM XL C language extensions.

For information on the various methods for controlling the language level for compilation, see Invoking the compiler and -qlanglvl.

Extensions related to C11 standard features

C11
Note: IBM supports selected features of C11, known as C1X 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 C11 features is complete, including the support of a new C11 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 C11 features.
C11

XL C supports the currently implemented C11 features as part of a continual phased release process leading towards full compliance with C11. A complete list of C11 features supported in XL C is provided in C11 compatibility.

Extensions related to GNU C

Certain language extensions that correspond to GNU C features are implemented to facilitate portability. These include extensions to C89 and C99. Throughout this information, the text indicates the IBM® extensions that have been implemented for compatibility with GNU C ; a complete list of these is provided in Extensions for GNU C compatibility for C++ only.

Extensions supporting and extending the AltiVec Programming Interface

XL C supports and extends AltiVec vector types when vector support is enabled. These language extensions exploit the SIMD and parallel processing capabilities of the PowerPC® processor, and facilitate the associated optimization techniques. The IBM implementation of the AltiVec Programming Interface specification is an extended implementation, which, for the most part, matches the syntax and semantics of the GNU C implementation. In addition to the text provided throughout this information that describes the behavior of the vector extensions, a list of the IBM extensions to the AltiVec Programming Interface is also provided in Extensions for vector processing support.

Extensions supporting Unicode

The Unicode Standard is the specification of an encoding scheme for written characters and text. It is a universal standard that enables consistent encoding of multilingual text and allows text data to be interchanged internationally without conflict. The ISO C Committee has approved the implementation of u-literals and U-literals to support Unicode UTF-16 and UTF-32 character literals, respectively. See Extensions for Unicode support for details.



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