Re: [PATCH 2/2] lib: fix glibc-2.43 w/ clang

Subject: Re: [PATCH 2/2] lib: fix glibc-2.43 w/ clang

Date: Mon, 16 Feb 2026 11:51:59 +0100

To: Michael J Gruber, David Bremner

Cc: Nicolas PARLANT, notmuch@notmuchmail.org

From: Martin Jambor


Hello,

On Mon, Feb 16 2026, Michael J Gruber wrote:
> Am So., 15. Feb. 2026 um 23:13 Uhr schrieb David Bremner <david@tethera.net>:
>>
>> Nicolas PARLANT <nicolas.parlant@parhuet.fr> writes:
>>
>> >>notmuch-insert.c:136:11: error: assigning to 'char *' from 'const char *'
>> >>      discards qualifiers
>> >>      [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
>> >>  136 |     slash = strrchr (path, '/');
>> >>      |           ^ ~~~~~~~~~~~~~~~~~~~
>>
>> Thanks for the patch. The change itself looks fine, but the (subject of)
>> the commit message is a bit cryptic. We use "lib:" for code in the lib/
>> or (maybe util/) directory. This is obvious not a fix for glibc, but
>> that's what a naive reader (like me) might think.
>
> That makes two of us :)
>
> Also: How is the patch related to glibc version? Has the declaration
> of strrchr() changed?

See https://sourceware.org/pipermail/libc-alpha/2026-January/174374.html
specifically:

  * For ISO C23, the functions bsearch, memchr, strchr, strpbrk, strrchr,
    strstr, wcschr, wcspbrk, wcsrchr, wcsstr and wmemchr that return
    pointers into their input arrays now have definitions as macros that
    return a pointer to a const-qualified type when the input argument is
    a pointer to a const-qualified type.

(and similar items in the list)

Martin
_______________________________________________
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-leave@notmuchmail.org

Thread: