Keywords

Keywords are identifiers reserved by the language for special use. Although you can use them for preprocessor macro names, it is poor programming style. Only the exact spelling of keywords is reserved. For example, auto is reserved but AUTO is not. The following lists the keywords common to both the C and C++ languages:

auto
break
case
char
const
continue
default
do
double
else

enum
extern
float
for
goto
if
inline

int
long
register

return
short
signed
sizeof
static
struct
switch
typedef
union
unsigned

void
volatile
while

C The C language also reserves the following keywords:

restrict
_Bool
_Complex
_Imaginary

uint_least16_t
uint_least32_t

C++The C++ language also reserves the following keywords:

asm
bool
catch
class
const_cast
delete
dynamic_cast
explicit

export
false
friend
mutable
namespace
new
operator
private

protected
public
reinterpret_cast
static_cast
template
this
throw
true

try
typeid
typename
using
virtual
wchar_t

Keywords for Language Extensions

Linux In addition to standard language keywords, XL C/C++ reserves identifiers for language extensions, ease of porting applications developed with the GNU C compiler, and for future use. The following keywords are reserved for use in language extensions:

pixel
typeof
vector

__align
__asm
__pixel
__restrict
__vector
__alignof__

__asm__
__attribute__
__complex__
__const__
__extension__
__imag__

__inline__
__label__
__real__
__signed__
__typeof__
__volatile__

The tokens vector, pixel, and bool are recognized as keywords only when used in a vector declaration context and when the AltiVec language extensions are enabled.

C++The IBM implementation of C++ reserves the following keywords as language extensions for compatibility with C99.

restrict
__restrict__
_Complex
_Imaginary

uint_least16_t
uint_least32_t

 
IBM Copyright 2003