[tz] [PROPOSED 2/5] Pacify gcc -std=c89 -pedantic with new attributes

Paul Eggert eggert at cs.ucla.edu
Tue Nov 29 21:55:05 UTC 2022


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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Be-more-consistent-about-HAVE_-names.patch
Type: text/x-patch
Size: 4459 bytes
Desc: not available
URL: <http://mm.icann.org/pipermail/tz/attachments/20221129/e5385885/attachment.bin>


More information about the tz mailing list