Jump to content

C23 (C standard revision)

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by Fezzy1347 (talk | contribs) at 00:51, 15 January 2021 (Hyphen (-) U2192). 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] It is not expected to be voted on until December 2021.[2][3]

Features

Among proposed features:

  • single-argument _Static_assert
  • C++11 style attribute syntax[4]
  • extended binary floating-point arithmetic, decimal floating-point arithmetic
  • memccpy(), strdup(), strndup() – similar to functions found in the POSIX and SVID C extensions
  • char8_t type, in the same vein as char16_t and char32_t added in C11 (proposal N2231).
  • add a new principle to the "original principles" of C: "15. Application Programming Interfaces (APIs) should be self-documenting when possible. In particular, the order of parameters in function declarations should be arranged such that the size of an array appears before the array. The purpose is to allow Variable-Length Array (VLA) notation to be used. This not only makes the code's purpose clearer to human readers, but also makes static analysis easier. Any new APIs added to the Standard should take this into consideration."[5]

Support

The GCC 9[3] and Clang 9.0[4] compilers support the -std=c2x option to support this standard.

References

  1. ^ "History of C". cppreference.
  2. ^ "WG 14 N 2086 -- C2x Charter". www.open-std.org. Retrieved 2021-01-03.
  3. ^ a b Michael Larabel (2018-10-18). "GCC 9 Compiler Adds -std=c2x And -std=gnu2x For Future C Language Update".
  4. ^ a b Michael Larabel (2019-05-14). "LLVM Clang 9.0 Picks Up Initial C2x Language Mode".
  5. ^ "WG 14 N 2086 -- C2x Charter". www.open-std.org.
Preceded by C language standards Latest