On 11/29/22 12:21, Brian Inglis via tz wrote:
How about HAVE_C23_ATTRIBUTE_CHECK, HAVE_C2X_ATTRIBUTE_CHECK, or something similarly more meaningful and less confusing?
If one knows GCC and/or Clang well, the name HAVE_C23_ATTRIBUTE_CHECK could be confusing since the current releases of these compilers support __has_c_attribute even though they don't support C23 yet. Currently, private.h uses the naming convention of Autoconf, e.g., "HAVE_SYMLINK" is true if symlink(...) works. Although readers unfamiliar with POSIX might more easily understand a name like "HAVE_SYMBOLIC_LINKS", the name "HAVE_SYMLINK" is better for someone who knows the POSIX API since it looks more like a POSIX symlink(...) call. Similarly, HAVE___HAS_C_ATTRIBUTE is probably better for people who know about __has_c_attribute, including the fact that it's available on some popular non-C23 compilers. In looking through the HAVE_* identifiers I see one other identifier with a similar consistency issue, namely HAVE_GENERIC. To try to address this I installed the attached. It may be a bit uglier but at least it's a bit more consistent.