Subsetting the C Standard

Document: N1460
Date: 10-May-2010
Author: P.J. Plauger
Related documents: WG14/N1395
CHANGE 4. Conformance, footnote 3 FROM:
3) A strictly conforming program can use conditional features (such as those in annex F) provided the use is guarded by a #ifdef directive with the appropriate macro.
TO:
3) A strictly conforming program can use conditional features (such as those in 6.10.8 or annex F) provided the use is guarded by a #ifdef directive with the appropriate macro.
CHANGE 6.10.8 Predefined Macro Names, para 2:
The following macro names are conditionally defined by the implementation:
__STDC_IEC_559_ The integer constant 1, intended to indicate conformance to the specifications in annex F (IEC 60559 floating-point arithmetic).
__STDC_IEC_559_COMPLEX_ The integer constant 1, intended to indicate adherence to the specifications in informative annex G (IEC 60559 compatible complex arithmetic).
__STDC_ISO_10646_ An integer constant of the form yyyymmL (for example, 199712L). If this symbol is defined, then every character in the Unicode required set, when stored in an object of type wchar_t, has the same value as the short identifier of that character. The Unicode required set consists of all the characters that are defined by ISO/IEC 10646, along with all amendments and technical corrigenda, as of the specified year and month.
BY ADDING:
__STDC_NO_COMPLEX_ The integer constant 1, intended to indicate that the implementation shall accept only a strictly conforming program that does not use complex types, does not include the header <complex.h>, and does not make any use of entities declared or defined in this header.
__STDC_NO_THREADS_ The integer constant 1, intended to indicate that the implementation shall accept only a strictly conforming program that does not include either of the headers <stdatomic.h> or <threads.h>, and does not make any use of entities declared or defined in these headers.
__STDC_NO_VLA_ The integer constant 1, intended to indicate that the implementation shall accept only a strictly conforming program that does not use variable length arrays.
RATIONALE:
Two of the largest additions to C99 were complex arithmetic and variable length arrays; and the largest addition to C1X is threads and atomics. To ease conformance to C1X, and in the hopes of increasing mainstream adoption of C1X, it seems prudent to allow any or all of these three large components to be omitted in an implementation without losing the cachet of compliance. (The grouping of threads and atomics is intentional.) This is an intentional departure from the C89 practice of minimizing subsetting to hosted vs. freestanding.
NOTES:

Also see the JTC 1/SC 22 plenary resolution 09-16:

Netherlands Contribution on Growth of Programming Language Standards JTC 1/SC 22, noting the discussion on SC 22 N 4484 (Netherlands Contribution on the Growth of Programming Language Standards), recommends its Working Group Conveners to distribute SC 22 N 4484 on the Growth of Programming Language Standards to their Working Groups as a JTC 1/SC 22 recommended document on guidance to address the issues identified in this document.