C11 (C standard revision)

C11 is the unofficial name of the current standard for the C programming language (ISO/IEC 9899:2011[1]), informally known as C1X before final standard publication. It replaces the previous C standard, informally known as C99. This new version mainly standardizes features that have already been supported by common contemporary compilers, and includes a detailed memory model to better support multiple threads of execution. Due to delayed availability of conforming C99 implementations, C11 makes more features optional, to make it easier to comply with the core language standard.[2][3]

The final draft, N1570[4], was published in April 2011. The new standard passed its final draft review on October 10, 2011 and was officially ratified by ISO and published as ISO/IEC 9899:2011 on 8th December, 2011, with no comments requiring resolution from participating national bodies.

GCC version 4.6 has added initial support for some features from the C11 draft.[5]

Contents

Changes from C99

The standard includes several changes to the C99 language and library specifications, such as:[6]

#define cbrt(X) _Generic((X), long double: cbrtl, \
                              default: cbrt, \
                              float: cbrtf)(X)

Optional features

The new revision allows implementations not to support certain parts of the standard — including some that had been mandatory to support in the 1999 revision.[10] Programs can use predefined macros to determine whether an implementation supports a certain feature or not.

Optional features in C11
Feature Feature test macro Availability in C99[11]
Analyzability (Annex L) __STDC_ANALYZABLE__ Not available
IEC 60559 floating-point arithmetic (Annex F) __STDC_IEC_559__ Optional
IEC 60559 compatible complex arithmetic (Annex G) __STDC_IEC_559_COMPLEX__ Optional
Bounds-checking interfaces (Annex K) __STDC_LIB_EXT1__ Not available
Complex types (<complex.h>) __STDC_NO_COMPLEX__ Mandatory
Multithreading (<threads.h>) __STDC_NO_THREADS__ Not available
Atomic primitives and types (<stdatomic.h> and the _Atomic type qualifier)[12] __STDC_NO_ATOMICS__ Not available
Variable length arrays __STDC_NO_VLA__ Mandatory

See also

References

External links

Preceded by
C99
C language standards Most recent