C2x

C2x is an informal name for the next (after C18) major C language standard revision.[1] It is not expected to be voted on until 2021.[2]

Features

Among proposed features:

  • single-argument _Static_assert
  • C++11 style attribute syntax[3]
  • 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).

It adds 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.[4]

Support

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

gollark: Also, yes, the context is quite different so reasons from then may not apply.
gollark: It's also possible that more complex systems may have been impractical before computers came along, although that doesn't apply to, say, approval voting.
gollark: First-past-the-post is the simplest and most obvious thing you're likely to imagine if you want people to "vote for things", and it's entirely possible people didn't look too hard.
gollark: I don't know if the people designing electoral systems actually did think of voting systems which are popular now and discard them, but it's not *that* much of a reason to not adopt new ones.
gollark: There are plenty of things in, say, maths, which could have been thought up ages ago, and seem stupidly obvious now, but weren't. Such as modern place value notation.

References

Preceded by
C18
C language standards Latest
This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.