-X cc
This option is used to select the C language mode. It only needs to be specified if the compiler is to run in C mode, but is not called by cc
, c11
or c89
.
-X CC
This option is used to select the C++ language mode. It only needs to be specified if the compiler is to run in C++ mode, but is not called by CC
.
-X 89
-X 90
-X 1990
C89 mode (the default setting when calling the compiler with c89
)
This option is only allowed in C mode. The compiler supports C code, as defined in the ANSI/ISO C standard from 1990. This standard is also known as the ANSI C89 standard. This specification corresponds to the specification -X a
or -X c
of the C/C++ V3 compiler.__STDC_VERSION__
has a value of 199409L.
-X 11
-X 2011
C11 mode (the default setting when calling the compiler with cc
or c11
or specifying -X cc
)
This option is only allowed in C mode. The compiler supports C code according to the 2011 C standard.__STDC_VERSION__
has a value of 201112L.
-X kr
-X KR
K&R C mode
This option is only allowed in C mode. This mode should not be used for new developments. It is typically intended for porting "old" K&R C sources and/or systematic conversions to ANSI C.
The compiler accepts C code, as defined by Kernighan&Ritchie in the reference manual ("The C Programming Language", First Edition). It also supports C language elements of the ANSI C standard that are semantically identical to the Kernighan&Ritchie "definition" of the C language (e.g. function prototypes, const
, volatile
). This simplifies the conversion of a K&R C source to ANSI C. All C library functions of the system (i.e. ANSI functions, POSIX and X/OPEN functions, UNIX extensions) are available for use. As far as the preprocessor behavior is concerned, ANSI/ISO C is the default. If desired, the option -K kr_cpp
can be specified to convert the preprocessor behavior to K&R C (as required when porting old C sources, for example).__STDC_VERSION__
is undefined. The option -X strict has no effect, i.e. -X nostrict always applies.
-X 17
-X 2017
C++ 2017 mode
This option is only allowed in C++ mode. The compiler supports C++ code according to the 2017 C++ standard.
__cplusplus
has a value of 201703L and __STDC_VERSION__
a value of 199409L.
-X 20
-X 2020
C++ 2020 mode (the default setting when calling the compiler with CC
or specifying -X CC
)
This option is only allowed in C++ mode. The compiler supports C++ code according to the 2020 C++ standard. Full C++ 2020 library support is currently not available and instead the existing C++ 2017 library is used.
__cplusplus
has a value of 202002L and __STDC_VERSION__
a value of 199409L.
-X V2-COMPATIBLE
-X v2-compatible
Cfront-C++ mode
This option is only allowed in C++ mode.
This mode is only offered for compatibility reasons and should not be used for new developments. It supports the C++ language elements of Cfront V3.0.3, which was first released with the C++ V2.1 compiler. The Cfront-compatible C++ library for complex mathematics and stream-oriented I/O is available.
More information on the Cfront C++ library can be found in the C/C++ User Guide [4 ].
C++ sources must be compiled and linked with -X v2-compatible
if their objects are to be linkable with C++ V2.1/V2.2 objects.
This specification corresponds to the specification -X d
of the C/C++ V3 compiler.__cplusplus
has a value of 1 and __STDC_VERSION
the value 199409L. The option -X strict has no effect, i.e. -X nostrict always applies.
-X V3-COMPATIBLE
-X v3-compatible
C++ V3 mode
This option is only allowed in ++C mode. The compiler supports C++ code corresponding to the C/C++ V3 compiler. The specification corresponds to the specification -X w
or -X e
of the C/C++ V3 compiler.
The following C++ libraries are available:
the standard C++ library (strings, containers, iterators, algorithms, and numerics), including the Cfront-compatible I/O classes
the C++ V3 library Tools.h++
For more information on C++ libraries, see also the C++ User Guide [4].
__cplusplus
has a value of 2 (for -X nostrict
) or 199612L (for -X strict
) and __STDC_VERSION
has the value 199409L.
-X strict
Strict C- resp. C++ mode
The namespace is restricted to the names defined in the standard, and only the C resp. C++ library functions defined in the standard are available. Certain extensions (such as the asm keyword) and some commonly expected header file declarations (stdio.h, stdlib.h etc.) are not available.
Deviations from the standard result in compiler messages (mostly warnings). If desired, the output of errors can be forced in such cases by specifying the option -R strict_errors
(see "Options for controlling message output").__STDC__
has a value of 1, _STRICT_STDC
is defined
-X nostrict
Extended C- resp. C++ mode
Some required diagnostics are omitted, the name space is not restricted to names that are specified by the standard and some extensions are included.
__STDC__
has a value of 0, _STRICT_STDC
is not defined
-K library_version=n
-K library_version=high
This option specifies the library version for C++ 2017 and C++ 2020.
The library version has an effect on the libraries used for include file search and resolving. With library version 1 they are /usr/include/CXX01
and SYSLNK.CRTE.CXX01
, with library version 2 they are /usr/include/CXX02
and SYSLNK.CRTE.CXX02
.
See the C/C++ user guide [4] for more details.