C2x
Jump to navigation
Jump to search
C language revisions |
---|
C2x is an informal name for the next (after C17) major C language standard revision.[1][2] It is expected to be voted on in 2023 and would therefore be C23.[3]
Features[edit]
Changes integrated into the latest working draft are:
- Support for the ISO/IEC 60559:2020, the current version of the IEEE 754 standard for floating-point arithmetic, with extended binary floating-point arithmetic and decimal floating-point arithmetic
- Single-argument _Static_assert
- C++11 style attribute syntax and the
nodiscard
,maybe_unused
,deprecated
, andfallthrough
attributes memccpy()
,strdup()
,strndup()
– similar to functions found in the POSIX and SVID C extensions- Two's complement signed integer representation is required
- Removal of K&R function definitions
- Labels can appear before declarations and at the end of compound statements
- Unnamed parameters in function definitions[4]
- Binary literals such as
0b10101010
, and%b
conversion specifier forprintf()
function family - Better support for using const with arrays[5]
- Type generic functions for performing checked integer arithmetic (Integer overflow)
_BitInt(N)
andunsigned _BitInt(N)
types for bit-precise integers#elifdef
and#elifndef
- Digit separators:
0xFF'FF'FF'FF
- Standardization of the
typeof(...)
(typeof) operator[6] - Variably-modified types (but not VLAs which are automatic variables allocated on the stack) become a mandatory feature
- Zero initialization with
{}
(including initialization of VLAs) alignas
,alignof
,bool
,true
,false
,static_assert
,thread_local
become keywords[7]- A
memset_explicit()
function for erasing sensitive data #embed
for binary resource inclusion.
Support[edit]
The GCC 9,[8] Clang 9.0,[9] and Pelles C 11.00[10] compilers implement a compiler flag to support this standard.
References[edit]
- ^ "History of C". cppreference.
- ^ Keaton, David (2016-09-19). "WG 14 N 2086 -- C2x Charter". www.open-std.org. Retrieved 2021-01-03.
- ^ "Revised C23 Schedule WG 14 N 2759" (PDF). www.open-std.org. Retrieved 2021-06-19.
- ^ "Proposal for C2x WG14 N2480" (PDF). www.open-std.org.
- ^ "C2x Proposal: WG14 N2607" (PDF). www.open-std.org.
- ^ Meneide, JeanHeyd (2022-01-01). "Not-So-Magic - typeof(…) in C". Retrieved 2022-03-25.
- ^ Gustedt, Jens (2022-02-16). "Make false and true first-class language features v8" (PDF). Retrieved 2022-05-26.
- ^ "GCC 9 Changes". GCC 9 Release Notes.
- ^ "Add a new language mode for C2x". LLVM Project Repository.
- ^ "major changes between 10.00 and 11.00".