-
Notifications
You must be signed in to change notification settings - Fork 0
C23 Features
Derek Snider edited this page May 19, 2026
·
1 revision
madc includes early coverage of features from the C23 standard.
_Bool flag = 1;
_Bool arr[3] = { 1, 0, 1 };_Bool aliases to madc's bool type.
int x = 0b11001010;
int y = 0B1111;Compile-time assertions with arithmetic, sizeof, and alignof expressions:
static_assert(sizeof(int) == 8, "int must be 8 bytes");
_Static_assert(sizeof(char) == 1, "char must be 1 byte");Type inference from expressions or types:
int x = 42;
typeof(x) y = 100; // y is int
typeof(int *) p = &x; // p is int*Typed null pointer literal:
int *p = nullptr;
if (p == nullptr) {
cout << "null" << endl;
}Single quotes as visual separators in numeric literals:
int million = 1'000'000;
int hex = 0xFF'FF;
int bin = 0b1010'1010;
double pi = 3.141'592'653;Query alignment requirements:
int a = alignof(int); // 8
int b = alignof(double); // 8
int c = alignof(char); // 1Works on primitives, pointers, structs, arrays, and member expressions.
Parsed as a no-op qualifier (accepted but not enforced):
void copy(char * restrict dest, const char * restrict src) {
// ...
}- GCC Compatibility — torture test parity status
-
Preprocessor —
#define, conditionals, pragmas - ← Back to Home