キーワード

キーワード は、言語の特別な用途のために予約された ID です。 キーワードは、プリプロセッサーのマクロ名に使用できますが、プログラミング・スタイルとしては良い方法ではありません。 キーワードの厳密なスペルのみが予約されています。 例えば、auto は予約されていますが、AUTO は予約されていません。 下記に、C および C++ 言語の両方に共通するキーワードをリストします。


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 C 言語では、次のキーワードも予約されています。


restrict
_Bool
_Complex
_Imaginary

uint_least16_t
uint_least32_t

C++C++ 言語では、次のキーワードも予約されています。


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

言語拡張用のキーワード

Linux XL C/C++ は、標準言語キーワードのほかに、言語拡張のため、GNU C コンパイラーで開発されたアプリケーション を移植しやすくするため、および将来の使用のために、ID を予約しています。 言語拡張での使用のために、次のキーワードが予約されています。

pixel
typeof
vector

__align
__asm
__pixel
__restrict
__vector
__alignof__

__asm__
__attribute__
__complex__
__const__
__extension__
__imag__

__inline__
__label__
__real__
__signed__
__typeof__
__volatile__

トークン vectorpixel、および bool は、 ベクトル宣言コンテキストで使用される場合、および AltiVec 言語拡張機能が 使用可能になっている場合のみ、キーワードとして認識されます。

C++C++ の IBM インプリメンテーションは、C99 との互換性を保つための言語拡張として、次のキーワードを予約しています。

restrict
__restrict__
_Complex
_Imaginary

uint_least16_t
uint_least32_t

 
IBM Copyright 2003