[RFC v3 2/4] string: Add streq,memeq,wcseq,wmemeq,strcaseeq[_l],wcscaseeq[_l] APIs
Alejandro Colomar
alx@kernel.org
Thu Sep 4 15:34:49 GMT 2025
- Previous message (by thread): [RFC v3 2/4] string: Add streq,memeq,wcseq,wmemeq,strcaseeq[_l],wcscaseeq[_l] APIs
- Next message (by thread): [RFC v3 2/4] string: Add streq, memeq, wcseq, wmemeq, strcaseeq[_l], wcscaseeq[_l] APIs
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Hi Paul,
On Thu, Sep 04, 2025 at 07:32:54AM -0700, Paul Eggert wrote:
> On 2025-09-03 03:05, Alejandro Colomar wrote:
> > +static __always_inline __bool
> > +(streq) (const char *__s1, const char *__s2)
> > +{
> > + return strcmp(__s1, __s2) == 0;
> > +}
>
> Although this works for GCC it's wrong for C compilers where __always_inline
> expands to just 'inline' (or to nothing for pre-C99). Such a streq cannot be
> called from an extern inline function, due to the unfortunate constraint in
> ISO C23 §6.7.5 ¶2 which says extern inline functions cannot refer to
> identifiers with static linkage.
Yup, I'm well aware of that constraint. I suffered it for years, being
unable to use extern inline functions at $dayjob-1 because we had a
dependency on a library that used static inline functions.
I bring excellent news for you.
The committee, after no small amount of convincing work, has accepted my
proposal <https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3622.txt>
for lifting that constraint. This happened at the Brno meeting, last
week, so we still don't have a draft with the proposal applied.
> Standard functions like streq must be callable from extern inline functions.
Have a lovely day!
Alex
--
<https://www.alejandro-colomar.es>
Use port 80 (that is, <...:80/>).
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/libc-alpha/attachments/20250904/f38656fd/attachment.sig>
- Previous message (by thread): [RFC v3 2/4] string: Add streq,memeq,wcseq,wmemeq,strcaseeq[_l],wcscaseeq[_l] APIs
- Next message (by thread): [RFC v3 2/4] string: Add streq, memeq, wcseq, wmemeq, strcaseeq[_l], wcscaseeq[_l] APIs
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Libc-alpha
mailing list