You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The upcoming C23 standard contains a number of new features, which we would like to add support for. This issue contains a list of significant new features in the draft C23 standard (derived from Annex M in the standard drafts). This includes features of both the language and libraries. Note that this is not a comprehensive list of all changes in the standard, and that some of these items are optional features that are not required to be implemented.
Items should be checked off in this list if they are fully implemented. If they are partially implemented, a note explaining that can be added.
add new keywords such as bool, static_assert, true, false, thread_local and others, and allowed implementations to provide macros for the older spelling with a leading underscore followed by a capital letter as well as defining old and new keywords as macros to enable transition of programs easily
alignas/alignof/bool/static_assert/thread_local are supported
removed integer width constraints and obsolete sign representations (so-called "1’s complement" and "sign-magnitude")
added a one-argument version of static_assert
removed support for function definitions with identifier lists
mandated function declarations whose parameter list is empty be treated the same as a parameter list which only contain a single void
harmonization with ISO/IEC 9945 (POSIX):
extended month name formats for strftime
no changes needed in the "C" locale as implemented by ORCA/C
integration of functions: gmtime_r, localtime_r, memccpy, strdup, strndup
harmonization with floating point standard IEC 60559:
integration of binary floating-point technical specification TS 18661-1
integration of decimal floating-point technical specification TS 18661-2
integration of floating-point types technical specification TS 18661-3
integration of mathematical functions technical specification TS 18661-4a
new maximum and minimum functions for operations recommended in ISO/IEC 60559:2020
made the DECIMAL_DIG macro obsolescent
no changes needed
added version test macros to library headers that contained changes to aid in upgrading and portability to be used alongside the __STDC_VERSION__ macro
allowed placement of labels in front of declarations and at the end of compound statement
added the attributes feature, which includes the attributes:
deprecated, for marking entities as discouraged for future use
fallthrough, for explicitly marking cases where falling through in switches or labels is intended rather than accidental
maybe_unused, for marking entities which may end up not being used
nodiscard, for marking entities which, when used, should have their value handled in some way by a program
noreturn, for indicating a function shall never return
reproducible, for marking function types for which inputs may always produce predictable output if given the same input (e.g., cached data) but for which the order of such calls still matter
unsequenced, for marking function types which always produce predictable output and have no dependencies upon other data (and other relevant caveats)
added the u8 character prefix to match the u8 string prefix
mandated all u8, u, and U strings be UTF-8, UTF-16, and UTF-32, respectively, as defined by ISO/IEC 10646
separated the literal, wide literal, and UTF-8 literal, UTF-16 literal, and UTF-32 literal encodings for strings and characters and now have a solely execution-based version of these, particularly execution and wide execution encodings
added mbrtoc8 and c8rtomb functions missing from <uchar.h>
compound literals may also include storage-class specifiers as part of the type to change the lifetime of the compound literal (and possibly turn it into a constant expression)
added the constexpr specifier for object definitions and improved what is recognized as a constant expression in conjunction with the constexpr storage-class specifier
added support for initialization of objects with empty braces
added the typeof and typeof_unqual operations for deducing the type of an expression
improved tag compatibility rules, enabling more types to be compatible with other types
added bit-precise integer types _BitInt(N) and unsigned _BitInt(N), where N can be an integer constant expression whose value is from one to BITINT_MAXWIDTH, inclusive
improved rules for handling enumerations without underlying types, in particular allowing for enumerations without fixed underlying type to have value representations that have a greater range than int
added a new colon-delimited type specifier for enumerations to specify a fixed underlying type (and which, subject to an implementation’s definitions governing such constructs, adopt the fixed underlying type’s rules for padding, alignment, and sizing within structures and unions as well as with bit-fields)
added a new header <stdbit.h> and a suite of bit and byte-handling utilities for portable access to many implementations’ most efficient functionality
modified existing functions to preserve the const-ness of the type placed into the function
added a feature to embed binary data as faithfully as possible with a new preprocessor directive #embed
added a nullptr constant and a nullptr_t type with a well-defined underlying representation identical to a pointer to void
added the __VA_OPT__ specifier and clarified language in the handling of macro invocation and arguments
mandated support for variably-modified types (but not variable-length arrays themselves)
parameter names may be omitted in function definitions
ellipses on functions may appear without a preceding parameter in the parameter list of functions and va_start no longer requires such an argument to be passed to it
Second argument to va_start is no longer required.
Unicode identifiers allowed in syntax following Unicode Standard Annex, UAX # 31
Mostly supported (in UCNs and for most supported characters, but not for the character ·)
added the memset_explicit function for making sensitive information inaccessible
added memalignment function to query the alignment of a pointer
certain type definitions (i.e., exact-width integer types such as int128_t), bit-precise integer types, and extended integer types may exceed the normal boundaries of intmax_t and uintmax_t for signed and unsigned integer types, respectively
no changes needed (larger types are not required)
names of functions, macros, and variables in the standard, where clarified, are potentially reserved rather than reserved to avoid undefined behavior for a large class of identifiers used by programs existing and to be created
mandated support for call_once
allowed ptrdiff_t to be an integer type with a width of at least 16, rather than requiring an integer type with a width of at least 17
no changes needed
added the __has_include feature for conditional inclusion expression preprocessor directives to check if a header is available for inclusion
changed the type qualifiers of the _Imaginary_I and _Complex_I macros
added qualifier preserving macros for bsearch, memchr, strchr, strpbrk, strrchr, strstr, wcschr, wcspbrk, wcsrchr, wmemchr, and wcsstr
added @ (U+0040 Commercial At), $ (U+0024 Dollar Sign), and ` (U+0060 Grave Accent, "Backtick") into the source and execution character set
enhanced the auto type specifier for single object definitions using type inference
added the #elifdef and #elifndef conditional inclusion preprocessor directives
added the #warning preprocessing directive
binary integer literals and appropriate formatting for input/output of binary integer numbers
binary integer literals are supported
digit separators with ' (single quotation mark)
removed conditional support for mixed wide and narrow string literal concatenation
added support for additional time bases, as well as timespec_getres, in <time.h>
added support for new interface timegm to retrieve the broken-down time, in <time.h>
zero-sized reallocations with realloc are undefined behavior
no changes needed
added free_sized and free_aligned_sized functions
added an unreachable feature which has undefined behavior if reached during program execution
added printf and scanf length modifiers for intN_t, int_fastN_t, uintN_t, and uint_fastN_t
The text was updated successfully, but these errors were encountered:
The upcoming C23 standard contains a number of new features, which we would like to add support for. This issue contains a list of significant new features in the draft C23 standard (derived from Annex M in the standard drafts). This includes features of both the language and libraries. Note that this is not a comprehensive list of all changes in the standard, and that some of these items are optional features that are not required to be implemented.
Items should be checked off in this list if they are fully implemented. If they are partially implemented, a note explaining that can be added.
bool
,static_assert
,true
,false
,thread_local
and others, and allowed implementations to provide macros for the older spelling with a leading underscore followed by a capital letter as well as defining old and new keywords as macros to enable transition of programs easilyalignas
/alignof
/bool
/static_assert
/thread_local
are supportedstatic_assert
void
strftime
gmtime_r
,localtime_r
,memccpy
,strdup
,strndup
DECIMAL_DIG
macro obsolescent__STDC_VERSION__
macrodeprecated
, for marking entities as discouraged for future usefallthrough
, for explicitly marking cases where falling through in switches or labels is intended rather than accidentalmaybe_unused
, for marking entities which may end up not being usednodiscard
, for marking entities which, when used, should have their value handled in some way by a programnoreturn
, for indicating a function shall never returnreproducible
, for marking function types for which inputs may always produce predictable output if given the same input (e.g., cached data) but for which the order of such calls still matterunsequenced
, for marking function types which always produce predictable output and have no dependencies upon other data (and other relevant caveats)u8
character prefix to match theu8
string prefixu8
,u
, andU
strings be UTF-8, UTF-16, and UTF-32, respectively, as defined by ISO/IEC 10646mbrtoc8
andc8rtomb
functions missing from<uchar.h>
constexpr
specifier for object definitions and improved what is recognized as a constant expression in conjunction with theconstexpr
storage-class specifiertypeof
andtypeof_unqual
operations for deducing the type of an expression_BitInt(N)
andunsigned _BitInt(N)
, where N can be an integer constant expression whose value is from one toBITINT_MAXWIDTH
, inclusive<stdbit.h>
and a suite of bit and byte-handling utilities for portable access to many implementations’ most efficient functionalityconst
-ness of the type placed into the function#embed
nullptr
constant and anullptr_t
type with a well-defined underlying representation identical to a pointer tovoid
__VA_OPT__
specifier and clarified language in the handling of macro invocation and argumentsva_start
no longer requires such an argument to be passed to itva_start
is no longer required.·
)memset_explicit
function for making sensitive information inaccessiblememalignment
function to query the alignment of a pointerint128_t
), bit-precise integer types, and extended integer types may exceed the normal boundaries ofintmax_t
anduintmax_t
for signed and unsigned integer types, respectivelycall_once
ptrdiff_t
to be an integer type with a width of at least 16, rather than requiring an integer type with a width of at least 17__has_include
feature for conditional inclusion expression preprocessor directives to check if a header is available for inclusion_Imaginary_I
and_Complex_I
macrosbsearch
,memchr
,strchr
,strpbrk
,strrchr
,strstr
,wcschr
,wcspbrk
,wcsrchr
,wmemchr
, andwcsstr
auto
type specifier for single object definitions using type inference#elifdef
and#elifndef
conditional inclusion preprocessor directives#warning
preprocessing directive'
(single quotation mark)timespec_getres
, in<time.h>
timegm
to retrieve the broken-down time, in<time.h>
realloc
are undefined behaviorfree_sized
andfree_aligned_sized
functionsunreachable
feature which has undefined behavior if reached during program executionprintf
andscanf
length modifiers forintN_t
,int_fastN_t
,uintN_t
, anduint_fastN_t
The text was updated successfully, but these errors were encountered: