[RFC v4 2/4] string: Add streq,memeq,wcseq,wmemeq,strcaseeq[_l],wcscaseeq[_l] APIs

Zack Weinberg zack@owlfolio.org
Sun Sep 14 15:19:05 GMT 2025


On Sun, Sep 14, 2025, at 11:04 AM, Paul Eggert wrote:
> On 2025-09-13 23:01, Alejandro Colomar wrote:
>> +#ifdef __USE_GNU
>> +/* Compare N bytes of M1 and M2 for equality.  */
>> +#define memeq(m1, m2, n)  ((__bool) !__memcmpeq(m1, m2, n))
>> +#endif
>
> I doubt whether the standardization committee would bless this.
> It's fine to have a macro, but there should also be a function

Reading this, I realized there's a practical reason why these need
external function definitions, as well: people are going to want
to use them as callbacks.

zw


More information about the Libc-alpha mailing list