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 will therefor be C23.[3]
Features
Changes integrated into the working draft are:[4]
- 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
- Binary literals such as
0b10101010
- Better support for using const with arrays
Further proposed features are:
- Type generic functions for performing checked integer arithmetic (Integer overflow)
_BitInt(N)
andUnsignedBitInt(N)
types for bit-precise integers- Standardization of the
typeof(...)
(typeof) operator[5] - A feature for binary resource inclusion in the preprocessor (
#embed
)
Support
The GCC 9[6] and Clang 9.0[7] compilers support the -std=c2x option 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.
- ^ ISO/IEC JTC1/SC22/WG14 (2020-12-12). "C2X Draft" (PDF).
{{cite web}}
: CS1 maint: numeric names: authors list (link) - ^ Meneide, JeanHeyd (2021-03-07). "Not-So-Magic - typeof(…) in C". Retrieved 2021-04-19.
- ^ Larabel, Michael (2018-10-18). "GCC 9 Compiler Adds -std=c2x And -std=gnu2x For Future C Language Update". Phoronix.
- ^ Larabel, Michael (2019-05-14). "LLVM Clang 9.0 Picks Up Initial C2x Language Mode". Phoronix.