Proven C Book←↑→

Appendix F — What C23 added, and where this book covers it

Every edition of the standard records “what changed” about itself (C23′s annex M.2). Taking that list as the frame, this appendix gathers where in this book each item is covered. It is a place for someone who already knows the new standard to ask “which chapter tells that story”, and equally for someone who has finished the book to check “did I meet all of C23”.

★ This book does not teach C23 separately. Rather than teaching the old way first and appending the new, it explains in C23 from the start and adds “it used to be like this” only where that helps. So the items below do not sit together; they are scattered through their own subjects. The three tables below stitch those places back together.

The language#

WhatIn briefWhere
bool, true, false and others promoted to keywordswhat were macros became keywordschapter 97
nullptr and nullptr_ta null constant with a type of its ownchapters 37 and 97
constexpran object whose value is fixed at translation timechapters 21 and 97
typeof, typeof_unqualwrite down an expression’s type verbatimchapter 97
auto type inferencethe type is drawn from the initialiserchapter 97
attributes [[…]]write intent no type can hold (seven of them)chapter 97
_BitInt(N)an integer whose width you choosechapters 21 and 28
two’s complement settled, old sign forms removedinteger representation pinned to onechapters 6 and 28
limits redefined in terms of widththe negative end of the guaranteed range movedchapter 28
binary literals 0bwrite bits as bitschapters 21 and 53
digit separator '1'000'000 reads in groupschapter 21
empty initialiser {}initialisation that zeroes the padding toochapter 47
storage class on compound literalstheir lifetime can be changedchapter 48
fixed underlying type for enumsenum E : unsigned { … }chapter 27
relaxed tag compatibilitysame-tag, same-content structs are compatible within one translation unit toochapter 47
labels in more placesbefore declarations and at a block’s endchapter 32
K&R identifier-list definitions removedthe old definition syntax is gonechapter 66
f() = f(void)empty parentheses now mean no parameterschapter 66
parameter names may be omittedeven in a definitionchapter 66
va_start needs no second argument... may stand with no parameter before itchapter 67
variably modified types mandatedVLAs themselves stay optionalchapter 40
Unicode identifierswhich characters may appear in a name is settledchapter 8
@, $ and the grave accent (U+0060) added to the character setmore characters may appear in sourcechapter 8
u8 character constantsthe string prefix now works on characterschapter 21
u8, u, U encodings pinnedsettled as UTF-8, UTF-16, UTF-32chapters 8 and 85
literal encodings separatedsplit apart from the execution character setchapter 8
wide/narrow literal concatenation removedmixing them is gonechapter 43
potentially reserved identifiersa middle level between reserved and notchapter 63
ptrdiff_t minimum width 16the requirement fell from 17chapter 27
width exception for extended integer typesallows things like int128_tchapter 28

Table 115.1 — What C23 changed in the language

The preprocessor#

WhatIn briefWhere
#embedbring binary data into the source as it ischapter 65
__VA_OPT__handles the empty variadic casechapter 65
__has_includeasks whether a header is therechapters 53 and 96
#elifdef, #elifndefthe short form of #elif definedchapter 65
#warningsays something without failingchapter 65
one-argument static_assertthe message may be left outchapter 90

Table 115.2 — What C23 added to the preprocessor

The library#

WhatIn briefWhere
<stdbit.h>counting and rotating bits became standard functionschapters 53 and 93
<stdckdint.h>arithmetic that reports overflow as a valuechapters 56 and 96
unreachablepromises that control never comes herechapter 56
memset_explicitan erase the optimiser may not removechapter 80
memalignmentasks a pointer for its alignmentchapter 77
qualifier-preserving search functionsput in a const, get a const backchapter 80
free_sized, free_aligned_sizedtell the allocator the size you knowchapter 99
realloc(p, 0) is UB (undefined behavior)an old grey zone moved outside the contractchapter 46
several time bases, timespec_getresa monotonic clock, and asking its resolutionchapter 89
timegmthe UTC counterpart of mktimechapter 89
mbrtoc8, c8rtombthe UTF-8 pair <uchar.h> was missingchapter 85
call_once mandatedno longer optionalchapter 94
POSIX functions folded in (strdup and others)common practice became standardchapters 79–80
length modifiers for intN_tprintf and scanf know the fixed-width typeschapter 76
binary integer I/O %bprints and reads 0bchapter 53
per-header version test macrosa header states what it haschapter 19
DECIMAL_DIG obsolescentthe per-type macros take overchapter 28
_Imaginary_I qualifiers adjusteda small repair in an optional headerchapter 93
harmonised with IEC 60559follows the floating-point standard more closelychapter 54
effective-type rules made precisethe ground of aliasing grew clearerchapter 40

Table 115.3 — What C23 changed in the library

How to use these tables#