Proven C Book←↑→

Appendix G — 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. This table stitches those places back together.

The language#

WhatIn briefWhere
bool, true, false and other promotionswhat were macros became wordschapter 87
nullptr and nullptr_ta null constant with a type of its ownchapters 37 and 87
constexpran object whose value is fixed at translation timechapters 21 and 87
typeof, typeof_unqualwrite down an expression’s type verbatimchapter 87
auto type inferencethe type is drawn from the initialiserchapter 87
attributes [[…]]write intent no type can hold (seven of them)chapter 87
_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 51
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 compatibilitycompatible 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 62
f() = f(void)empty parentheses now mean no parameterschapter 62
parameter names may be omittedeven in a definitionchapter 62
va_start needs no second argument... may stand with no parameter before itchapter 63
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 75
literal encodings separatedsplit apart from the execution character setchapter 8
wide/narrow literal concatenation removedmixing them is gonechapter 43
potentially reserved identifiersa mark between reserved and notchapter 59
ptrdiff_t minimum width 16the requirement fell from 17chapter 27
width exception for extended integer typesallows things like int128_tchapter 28

Table 105.1 — What C23 added to the language

The preprocessor#

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

Table 105.2 — What C23 added to the preprocessor

The library#

WhatIn briefWhere
<stdbit.h>counting and rotating bits became standard functionschapters 51 and 83
<stdckdint.h>arithmetic that reports overflow as a valuechapters 54 and 86
unreachablepromises that control never comes herechapter 54
memset_explicitan erase the optimiser may not removechapter 70
memalignmentasks a pointer for its alignmentchapter 67
qualifier-preserving search functionsput in a const, get a const backchapter 70
free_sized, free_aligned_sizedtell the allocator the size you knowchapter 89
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 79
timegmthe UTC counterpart of mktimechapter 79
mbrtoc8, c8rtombthe UTF-8 pair <uchar.h> was missingchapter 75
call_once mandatedno longer optionalchapter 84
POSIX functions folded in (strdup and others)custom became standardchapters 69–70
length modifiers for intN_tprintf and scanf know the fixed-width typeschapter 66
binary integer I/O %bprints and reads 0bchapter 51
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 83
harmonised with IEC 60559follows the floating-point standard more closelychapter 52
effective-type rules made precisethe ground of aliasing grew clearerchapter 40

Table 105.3 — What C23 added to the library

How to use these tables#