C 11, also known as C11, is the informal name for ISO/IEC 9899:2011, which is the most recent major standard for the C programming language. This standard was published in December 2011, updating the previous C99 standard.
History and Development
- The development of C11 began in 2007, with the aim to refine and extend the capabilities of the C language while ensuring backward compatibility with older standards.
- The ISO working group responsible for C, WG14, worked on incorporating several new features and addressing known issues in C99.
- The standard was finalized in December 2011, hence the name C11.
Key Features of C11
- Improved Memory Management: C11 introduces features like _Alignof and _Alignas for better control over memory alignment, which can be crucial for performance optimization.
- Threading Support: One of the major additions in C11 is the support for threads through the C Threads library, providing functions like thrd_create(), thrd_join(), etc., to facilitate concurrent programming.
- Type-Generic Macros: With tgmath.h, C11 allows for type-generic macros which can operate on different types without explicit type casting.
- Static Assertions: The `_Static_assert` keyword was added to enable compile-time assertions, enhancing code reliability.
- New Library Functions: New functions were added to the standard library, including support for Unicode utilities, bounds-checking interfaces, and more.
- Optional Features: C11 introduced optional features like Annex K, which provides bounds-checking interfaces, though these are not required for full conformance to the standard.
Impact and Adoption
- While the adoption of C11 has been gradual, many modern C compilers now support its features, either fully or partially.
- Its features have been particularly beneficial in systems programming, embedded systems, and applications requiring low-level memory manipulation or concurrency.
External Links
Here are some related topics: