C23 for uninitiated—modern C idioms for expressive, safe, and performant code
Dawid Zalewski
Some of them, like the mandatory variably-modified types or the reinterpretation of the auto
keyword have made it more expressive. Others, like attributes, or macro improvements are great for library writers. There are also additions that make the language safer; among them, checked integer arithmetic macros, better const
-propagating functions, and a strong type for NULL
. But the most significant changes are those that we will all use: proper constants with constexpr
, generic function-like macros with _Generic
, well-behaved enum
s, the ability to #embed
binary files directly in the source code, or to initialize objects with {}
.
This session aims to be a tour de force of C23. We will dissect the new features and discuss how they affect the expressiveness and readability of code, improve compile- and run-time safety, or help compilers achieve better performance. While doing so, we will update old program fragments to use the new idioms and show how the new features interact with each other. We will also look at the current state of support for C23 in mainstream compilers and talk about how you can start using the new features today.