On this page
c/builtins
Prev: c | Up: c | Next: fundamentals
Rel: c/stdlib, Syntax, Types & Operators, Memory Layout & ABI
Ref: cppreference — C Keywords & Language
Tags: #public #prog #c #builtins #index
Overview
Built-in ISO C operators, predefined identifiers/macros, type qualifiers, storage-class specifiers, and primitive types available globally with zero #include headers.
Core (#tier/core)
- sizeof (Operator) — Compile-time operator (runtime only for VLAs) returning the size in bytes of a type or expression as
size_t. - __func__ (Predefined Identifier (C99)) — Function-local predefined identifier holding the name of the enclosing function as a NUL-terminated string.
- __FILE__ (Predefined Macro) — Expands to a string literal containing the presumed name of the current source file.
- __LINE__ (Predefined Macro) — Expands to an integer constant representing the current line number in the source file.
- const (Type Qualifier) — Marks an object or pointee as read-only through that access path.
- static (Storage-Class Specifier) — Gives file-scope functions/variables internal linkage (private to the
.cfile), or gives block-scope locals static storage duration. - _Static_assert (Declaration (C11; static_assert in C23)) — Fails compilation immediately if
const_exprevaluates to0at compile time. - void (Built-in Type) — Represents the absence of a value (empty return or parameter list) or an untyped generic object pointer (
void *). - char (Built-in Type) — Smallest addressable unit (always
sizeof(char) == 1). Signedness of plaincharis implementation-defined. - int (Built-in Type) — Natural signed integer type (at least 16 bits, 32 bits on modern LP64/LLP64 systems).
Standard (#tier/standard)
- _Alignof (Operator (C11; alignof in C23)) — Returns the alignment requirement in bytes of a type as
size_t. - typeof (Operator (C23)) — Yields the type of an expression at compile time (
typeof_unqualstripsconst/volatile/_Atomic). - __STDC_VERSION__ (Predefined Macro) — Expands to a
longinteger constant identifying the C standard version (201112LC11,201710LC17,202311LC23). - extern (Storage-Class Specifier) — Declares a variable or function with external linkage defined in another translation unit without allocating storage.
- inline (Function Specifier (C99)) — Hints the compiler to inline a function body; combine with
staticin headers (static inline) to avoid multiple-definition linker errors. - nullptr (Built-in Constant (C23)) — Type-safe null pointer constant introduced in C23 to replace ambiguous integer
0/NULLmacros.
Specialized (#tier/specialized)
- _Generic (Selection Expression (C11)) — Compile-time type-generic dispatch expression selecting a branch based on the controlling expression's type.
- restrict (Type Qualifier (C99)) — Promises that for the pointer's lifetime, the referenced memory is accessed only through pointers derived from
p(no aliasing). - volatile (Type Qualifier) — Prevents the compiler from optimizing away or caching reads/writes to an object whose value can change outside normal program flow.
- _Atomic (Type Qualifier (C11)) — Declares an object supporting data-race-free atomic operations across threads.
- _Thread_local (Storage-Class Specifier (C11; thread_local in C23)) — Gives each OS thread its own independent instance of a variable for the thread's lifetime.
- _Noreturn (Function Specifier (C11;
[[noreturn]]in C23)) — Informs the compiler that a function never returns to its caller (e.g., callsexit()orabort()).
Linked from
- tuts/c
- tuts/c/builtins/__FILE__
- tuts/c/builtins/__func__
- tuts/c/builtins/__LINE__
- tuts/c/builtins/__STDC_VERSION__
- tuts/c/builtins/_Alignof
- tuts/c/builtins/_Atomic
- tuts/c/builtins/_Generic
- tuts/c/builtins/_Noreturn
- tuts/c/builtins/_Static_assert
- tuts/c/builtins/_Thread_local
- tuts/c/builtins/char
- tuts/c/builtins/const
- tuts/c/builtins/extern
- tuts/c/builtins/inline
- tuts/c/builtins/int
- tuts/c/builtins/nullptr
- tuts/c/builtins/restrict
- tuts/c/builtins/sizeof
- tuts/c/builtins/static
- tuts/c/builtins/typeof
- tuts/c/builtins/void
- tuts/c/builtins/volatile
- tuts/c/stdlib
- tuts/c/stdlib/assert
- tuts/c/stdlib/ctype
- tuts/c/stdlib/errno
- tuts/c/stdlib/limits
- tuts/c/stdlib/math
- tuts/c/stdlib/setjmp
- tuts/c/stdlib/signal
- tuts/c/stdlib/stdarg
- tuts/c/stdlib/stdatomic
- tuts/c/stdlib/stdbool
- tuts/c/stdlib/stddef
- tuts/c/stdlib/stdint
- tuts/c/stdlib/stdio
- tuts/c/stdlib/stdlib
- tuts/c/stdlib/string
- tuts/c/stdlib/threads
- tuts/c/stdlib/time
- tuts/cpp/builtins
- tuts/cpp/builtins/sizeof_and_alignof
Related notes
- tuts/c Linked here; links to this page; shared tags: #c, #index, #prog
- tuts/c/builtins/__FILE__ Linked here; links to this page; shared tags: #builtins, #c, #prog
- tuts/c/builtins/__func__ Linked here; links to this page; shared tags: #builtins, #c, #prog
- tuts/c/builtins/__LINE__ Linked here; links to this page; shared tags: #builtins, #c, #prog
- tuts/c/builtins/__STDC_VERSION__ Linked here; links to this page; shared tags: #builtins, #c, #prog
- tuts/c/builtins/_Alignof Linked here; links to this page; shared tags: #builtins, #c, #prog
- tuts/c/builtins/_Atomic Linked here; links to this page; shared tags: #builtins, #c, #prog
- tuts/c/builtins/_Generic Linked here; links to this page; shared tags: #builtins, #c, #prog
- tuts/c/builtins/_Noreturn Linked here; links to this page; shared tags: #builtins, #c, #prog
- tuts/c/builtins/_Static_assert Linked here; links to this page; shared tags: #builtins, #c, #prog