Keywords

C2 has the following keywords:

  • module
  • local
  • import
  • as
  • public
  • bool
  • char
  • const
  • elemsof
  • enum
  • f32
  • f64
  • false
  • fn
  • i8
  • i16
  • i32
  • i64
  • isize
  • nil
  • offsetof
  • reg8
  • reg16
  • reg32
  • reg64
  • sizeof
  • static
  • struct
  • template
  • tlocal
  • to_container
  • true
  • type
  • u8
  • u16
  • u32
  • u64
  • union
  • usize
  • void
  • volatile
  • break
  • case
  • continue
  • default
  • else
  • fallthrough
  • for
  • goto
  • if
  • return
  • switch
  • while

Other

  • asm
  • assert
  • static_assert

Feature selection

  • #if
  • #ifdef
  • #ifndef
  • #elif
  • #else
  • #endif
  • #error
  • #warning

C keywords

In addition to the C2 keywords, there are a number of C keywords that can be used in interface files with their C semantics:

  • double
  • extern
  • float
  • long
  • short
  • signed
  • size_t
  • ssize_t
  • typedef
  • unsigned

Other C keywords are reserved to avoid compatibility problems:

  • alignas
  • alignof
  • auto
  • constexpr
  • do
  • inline
  • nullptr
  • register
  • restrict
  • thread_local
  • typeof
  • typeof_unqual