Jump to content

C23 (C standard revision)

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by Martin.uecker (talk | contribs) at 20:53, 19 June 2021 (link to typeof page). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

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, and fallthrough 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) and UnsignedBitInt(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

  1. ^ "History of C". cppreference.
  2. ^ Keaton, David (2016-09-19). "WG 14 N 2086 -- C2x Charter". www.open-std.org. Retrieved 2021-01-03.
  3. ^ "Revised C23 Schedule WG 14 N 2759" (PDF). www.open-std.org. Retrieved 2021-06-19.
  4. ^ ISO/IEC JTC1/SC22/WG14 (2020-12-12). "C2X Draft" (PDF).{{cite web}}: CS1 maint: numeric names: authors list (link)
  5. ^ Meneide, JeanHeyd (2021-03-07). "Not-So-Magic - typeof(…) in C". Retrieved 2021-04-19.
  6. ^ Larabel, Michael (2018-10-18). "GCC 9 Compiler Adds -std=c2x And -std=gnu2x For Future C Language Update". Phoronix.
  7. ^ Larabel, Michael (2019-05-14). "LLVM Clang 9.0 Picks Up Initial C2x Language Mode". Phoronix.

External links

Preceded by C language standards Latest