Keywords

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.

Table 4. C and C++ keywords
auto
break
case
char
const
continue
default
do
double
else
enum
extern
float
for
goto
if
int
long
register
return
short
signed
sizeof
static
struct
switch
typedef
union
unsigned
void
volatile
while
C only

Standard C at the C99 level also reserves the following keywords:

Table 5. C99 keywords
_Bool
_Complex
_Imaginary1
inline2
restrict3  

Notes:
  1. The keyword _Imaginary is reserved for future extension of complex number functionality. For current complex number functionality, use _Complex; see Complex literals for details.
  2. The keyword inline is only recognized under compilation with c99 or -qlanglvl=stdc99 or -qlanglvl=extc99 options (or equivalent pragmas) or with the option -qkeyword=inline. Note that the latter option is enabled by default for the xlc invocation command in the configuration file that is shipped with the compiler.
  3. The keyword restrict is only recognized under compilation with c99 or with the -qlanglvl=stdc99 or -qlanglvl=extc99 options (or equivalent pragmas) or the-qkeyword=restrict option.
End of C only
C++ only

The C++ language also reserves the following keywords:

Table 6. C++ keywords
asm
bool
catch
class
const_cast
delete
dynamic_cast
explicit
export
false
friend
inline
mutable
namespace
new
operator
private
protected
public
reinterpret_cast
static_cast
template
this
throw
true
try
typeid
typename
using
virtual
wchar_t
End of C++ only
IBM extension

Keywords for language extensions

In addition to standard language keywords, XL C/C++ reserves the following keywords for use in language extensions:

Table 7. Keywords for C and C++ language extensions
__restrict
__restrict__
__attribute__
__attribute
__signed__
__signed
__volatile__
typeof
__typeof__
__align
__alignof
__alignof__

__real__
__imag__
__complex__
__const__
__inline__1
__extension__
__label__
__asm
__asm__
asm


pixel2
__pixel2
vector2
__vector2
bool (C only)2
Notes:
  1. C only The __inline__ keyword uses the GNU C semantics for inline functions. For details, see Linkage of inline functions.
  2. These keywords are recognized only in a vector declaration context, when VMX support is enabled.
C++ only

XL C++ reserves the following keywords as language extensions for compatibility with C99.

Table 8. Keywords for C++ language extensions related to C99
_Complex
_Imaginary1
restrict
Notes:
  1. The keyword _Imaginary is reserved for future extension of complex number functionality. For current complex number functionality, use _Complex; see Complex literals for details.

End of C++ only
End of IBM extension