Hi Joseph, Aaron,

(Aaron, there's no code in this email, so you should be able to read it,
 I guess.  We're just discussing the naming of the operator.)

Context for readers: The C Committee has finally accepted this as
_Countof instead of _Lengthof, due to the concerns regarding confusion
with string length and the likely off-by-one errors it would cause.

I suspect we still want a __countof__ variant, to be able to use it in
library code without triggering pedantic diagnostics.  Aaron suggested
something in the __builtin_* namespace to avoid collisions with library
code using the __ namespace.

Can you please confirm if we should add a version of this operator that
need not be diagnosed under pedantic mode?  If so, I'll propose this
patch as is from v18 pristine (well, I'll need to check that it still
applies cleanly, and will need to re-run the tests, but shouldn't need
to modify anything in the code) when the GCC 16 development starts.  A
_Countof synonym, and <stdcountof.h>, would come in later patches after
this one is merged.

What do we want to do?  Should we agree on a name in GCC/Clang?


Have a lovely night!
Alex

-- 
<https://www.alejandro-colomar.es/>

Attachment: signature.asc
Description: PGP signature

Reply via email to