Keywords are identifiers reserved by the language
for special use. Although you can use them for preprocessor macro
names, it is considered poor programming style. Only the exact spelling
of keywords is reserved. For example, auto is reserved
but AUTO is not.
Keywords for the C and C++ languages
Table 1. C and C++ keywordsauto1
break
case
char
const
continue
default
do
|
double
else
enum
extern2
float
for
goto
if
|
int
long
register
return
short
signed
sizeof
static
|
struct
switch
typedef
union
unsigned
void
volatile
while
|
Notes: In C++11, the keyword auto is
no longer used as a storage class specifier. Instead, it is used as
a type specifier, which can deduce the type of an auto variable
from the type of its initializer expression.
- The keyword extern was previously
used as a storage specifier or as part of a linkage specification.
The C++11 standard adds a third usage to use this keyword to specify
explicit instantiation declarations.

|

Keywords for the C language only
Standard
C at the C99 and C11 levels also reserves the following keywords:
Table 2. C99 and C11 keywords_Atomic1
_Bool
_Complex
_Generic1
_Imaginary2
|
inline3
_Noreturn1
_Static_assert1
restrict4
|
Notes: These keywords are introduced due to the
C11 language level.
- The keyword _Imaginary is reserved
for possible future use. For complex number functionality, use _Complex;
see Complex literals (C only) for details.
- The keyword inline is
only recognized under compilation with c99 and above, or with
the LANGLVL(STDC99) or LANGLVL(EXTC99) options.
- The keyword restrict is
only recognized under compilation with c99 and above, or with
the LANGLVL(STDC99) or LANGLVL(EXTC99) options.
|


Keywords for the C++ language only
The C++ language also reserves the following keywords:
Table 3. C++ keywordsbool
catch
class
char16_t1
char32_t1
const_cast
constexpr
delete
|
dynamic_cast
decltype
explicit
export
false
friend
inline
mutable
namespace
|
new
operator
private
protected
public
reinterpret_cast
static_assert
static_cast
template
|
this
throw
true
try
typeid
typename
using
virtual
wchar_t
|
Note: These keywords are reserved only at the C++11
language level.
|

Keywords for language extensions
(IBM extension)
In
addition to standard language keywords, the
z/OS® XL C/C++ compiler
reserves the following keywords for use in language extensions:
Table 4. Keywords for C and
C++ language extensionsasm
__asm
__asm__
__attribute__
__attribute
__complex__ (C only)
__const__
__extension__
|
__imag__ (C only)
__inline__
_Noreturn2
__real__ (C only)
__restrict
__restrict__
__signed__
|
__signed
__static_assert1
typeof (C only)
__typeof__
vector3
__vector3
__volatile (C++ only)
__volatile__ (C++ only)
|
Notes: __static_assert is
a keyword for C language extension for compatibility with the C++11
standard.
_Noreturn is a keyword
for C++ language extension for compatibility with the
C11 standard.
- These keywords are recognized only when the VECTOR
compiler option is in effect.
|

The
z/OS XL C/C++ compiler
reserves the following keywords as language extensions for compatibility
with C99.
Table 5. Keywords for C++
language extensions related to C99|
restrict
|

z/OS XL C/C++ additionally reserves the following
for use as extensions:
Table 6. Keywords
for C/C++ language extensions on z/OS _Packed
__packed
|
__cdecl
_Export
|
__callback
__ptr32
__ptr64
__far1
|
Note: - Recognized only when the METAL compiler option
is in effect, which is currently only supported by z/OS XL C.
z/OS XL
C/C++ also reserves the following keywords for future use in both
C and C++:
Table 7. Reserved keywords
for future use| __alignof__
__extension__
__label__
_Pragma |

More detailed information regarding the compilation
contexts in which extension keywords are valid is provided in the
sections that describe each keyword.