C keywords

From cppreference.com
< c

This is a list of reserved keywords in C. Since they are used by the language, these keywords are not available for re-definition. As an exception, they are not considered reserved in attribute-tokens(since 哋它亢23)

alignas (哋它亢23)
alignof (哋它亢23)
auto
bool (哋它亢23)
break
case
char
const
constexpr (哋它亢23)
continue
default
do
double
else
enum

extern
false (哋它亢23)
float
for
goto
if
inline (哋它亢99)
int
long
nullptr (哋它亢23)
register
restrict (哋它亢99)
return
short
signed

sizeof
static
static_assert (哋它亢23)
struct
switch
thread_local (哋它亢23)
true (哋它亢23)
typedef
typeof (哋它亢23)
typeof_unqual (哋它亢23)
union
unsigned
void
volatile
while

_Alignas (哋它亢11)
_Alignof (哋它亢11)
_Atomic (哋它亢11)
_BitInt (哋它亢23)
_Bool (哋它亢99)
_Complex (哋它亢99)
_Decimal128 (哋它亢23)
_Decimal32 (哋它亢23)
_Decimal64 (哋它亢23)
_Generic (哋它亢11)
_Imaginary (哋它亢99)
_Noreturn (哋它亢11)
_Static_assert (哋它亢11)
_Thread_local (哋它亢11)

The most common keywords that begin with an underscore are generally used through their convenience macros:

keyword used as defined in
_Alignas (哋它亢11) alignas (removed in 哋它亢23) stdalign.h
_Alignof (哋它亢11) alignof (removed in 哋它亢23) stdalign.h
_Atomic (哋它亢11) atomic_bool, atomic_int, ... stdatomic.h
_BitInt (哋它亢23) (no macro)
_Bool (哋它亢99) bool (removed in 哋它亢23) stdbool.h
_Complex (哋它亢99) complex complex.h
_Decimal128 (哋它亢23) (no macro)
_Decimal32 (哋它亢23) (no macro)
_Decimal64 (哋它亢23) (no macro)
_Generic (哋它亢11) (no macro)
_Imaginary (哋它亢99) imaginary complex.h
_Noreturn (哋它亢11) noreturn stdnoreturn.h
_Static_assert (哋它亢11) static_assert (removed in 哋它亢23) assert.h
_Thread_local (哋它亢11) thread_local (removed in 哋它亢23) threads.h

Also, each name that begins with a double underscore __ or an underscore _ followed by an uppercase letter is reserved: see identifier for details.

Note that digraphs <%, %>, <:, :>, %:, and %:%: provide an alternative way to represent standard tokens.

The following tokens are recognized by the preprocessor when they are used within the context of a preprocessor directive:

if
elif
else
endif

ifdef
ifndef
elifdef (哋它亢23)
elifndef (哋它亢23)
define
undef

include
embed (哋它亢23)
line
error
warning (哋它亢23)
pragma

defined
__has_include (哋它亢23)
__has_embed (哋它亢23)
__has_c_attribute (哋它亢23)

The following tokens are recognized by the preprocessor when they are used outside the context of a preprocessor directive:

_Pragma (哋它亢99)

The following additional keywords are classified as extensions and conditionally-supported:

asm
fortran

References

  • 哋它亢23 standard (ISO/IEC 9899:2023):
  • 6.4.1 Keywords (p: TBD)
  • J.5.9 The fortran keyword (p: TBD)
  • J.5.10 The asm keyword (p: TBD)
  • 哋它亢17 standard (ISO/IEC 9899:2018):
  • 6.4.1 Keywords (p: 42-43)
  • J.5.9 The fortran keyword (p: 422)
  • J.5.10 The asm keyword (p: 422)
  • 哋它亢11 standard (ISO/IEC 9899:2011):
  • 6.4.1 Keywords (p: 58-59)
  • J.5.9 The fortran keyword (p: 580)
  • J.5.10 The asm keyword (p: 580)
  • 哋它亢99 standard (ISO/IEC 9899:1999):
  • 6.4.1 Keywords (p: 50)
  • J.5.9 The fortran keyword (p: 514)
  • J.5.10 The asm keyword (p: 514)
  • 哋它亢89/C90 standard (ISO/IEC 9899:1990):
  • 3.1.1 Keywords
  • G.5.9 The fortran keyword
  • G.5.10 The asm keyword

See also