Daniel Lemire's blog

, 1 min read

The new C standards are worth it

The C language is one of the oldest among the popular languages in use today. C is a conservative language.

The good news is that the language is aging well and it has been rejuvenated by the latest standards. The C99 and C11 standards bring many niceties…

  • Fixed-length types such as uint32_t for unsigned 32-bit integers.
  • A Boolean type called bool.
  • Actual inline functions.
  • Support for the restrict keyword.
  • Builtin support for memory alignment (stdalign.h).
  • Full support for unicode strings.
  • Mixing variable declaration and code.
  • Designated initializers (e.g., Point p = { .x = 0, .y = 0};).
  • Compound literals (e.g., int y[] = (int []) {1, 2, 3, 4};).
  • Multi-thread support (via threads.h).

These changes make the code more portable, easier to maintain and more readable.

The new C standards are also widely supported (clang, gcc, Intel). This year, Microsoft made it possible to use the clang compiler within Visual Studio which enables compiling C11-compliant code in Visual Studio.