3954. Feature-test macros in C headers (<stddef.h> etc.)

Section: 17.14.1 [support.c.headers.general] Status: New Submitter: Jiang An Opened: 2023-07-06 Last modified: 2023-07-08 11:49:25 UTC

Priority: Not Prioritized

View all issues with New status.

Discussion:

Several feature-test macros are available in C++ versions of C headers (e.g. __cpp_lib_byte is available in <cstddef>). However, the current standard wording doesn't seem to make the distinction between C++ library feature-test macros and macros from C, so it's not very clear that whether <stddef.h> and its friends are required to provide __cpp_lib_* macros in C++.

Presumably, name.h should provide macros shown in the synopsis of its corresponding cname (as required in C), but should not be required to provide C++ library feature-test macros because such requirement would generally require implementations of the C standard library to change. I think we should make clarification in 17.14.1 [support.c.headers.general].

Proposed resolution: