I'm looking for a list of C standard library headers conformance report - as in, which headers are optional, which are mandatory for conforming compilers - for all C standards (or C20 at least).
2 Answers
C17 (the current C standard) lists the standard headers as:
<assert.h> <math.h> <stdlib.h>
<complex.h> <setjmp.h> <stdnoreturn.h>
<ctype.h> <signal.h> <string.h>
<errno.h> <stdalign.h> <tgmath.h>
<fenv.h> <stdarg.h> <threads.h>
<float.h> <stdatomic.h> <time.h>
<inttypes.h> <stdbool.h> <uchar.h>
<iso646.h> <stddef.h> <wchar.h>
<limits.h> <stdint.h> <wctype.h>
<locale.h> <stdio.h>
The standard says this in a footnote to Section 7.1.2 "Standard headers":
The headers <complex.h>, <stdatomic.h>, and <threads.h> are conditional features that implementations need not support; see 6.10.8.3
Section 6.10.8.3 ("Conditional feature macros") in turn has this to say about those headers:
__STDC_NO_ATOMICS__
The integer constant 1, intended to indicate that the implementation does not support atomic types (including the _Atomic type qualifier) and the<stdatomic.h>
header.
__STDC_NO_COMPLEX__
The integer constant 1, intended to indicate that the implementation does not support complex types or the<complex.h>
header.
__STDC_NO_THREADS__
The integer constant 1, intended to indicate that the implementation does not support the<threads.h>
header.
Finally, C17 says this about "conforming freestanding" implementations (Section 4 "Conformance"):
A conforming freestanding implementation shall accept any strictly conforming program in which the use of the features specified in the library clause (clause 7) is confined to the contents of the standard headers
<float.h>
,<iso646.h>
,<limits.h>
,<stdalign.h>
,<stdarg.h>
,<stdbool.h>
,<stddef.h>
,stdint.h>
, and<stdnoreturn.h>
.

- 195,579
- 13
- 168
- 312

- 333,147
- 50
- 533
- 760
cppreference.com will give you all standards for C89 to C23 and C++98 to C++23. There is no C20 standard though, C17 was the last and C23 is the next.
-
It does, but I was looking for more of a draft / official document kind-a-thing. Thanks by the way. – barahin844 Oct 02 '21 at 05:24