[RFC v3 2/4] string: Add streq,memeq,wcseq,wmemeq,strcaseeq[_l],wcscaseeq[_l] APIs
Paul Eggert
eggert@cs.ucla.edu
Thu Sep 4 14:32:54 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 ]
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.
Standard functions like streq must be callable from extern inline functions.
- 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