C23 (C standard revision)
Appearance
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
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.
- Single-argument _Static_assert
- C++11 style attribute syntax and the
nodiscard
,maybe_unused
,deprecated
, andfallthrough
attributes - Extended binary floating-point arithmetic, decimal floating-point arithmetic
memccpy()
,strdup()
,strndup()
– similar to functions found in the POSIX and SVID C extensions- Two’s complement sign 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)
andUnsignedBitInt(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[clarification needed] 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[citation needed]
Support
The GCC 9,[7] Clang 9.0,[8] and Pelles C 11.00[9] compilers implement a compiler flag to support this standard.
References
- ^ "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.
- ^ "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".