Skip to content

fix initialization discards 'const' qualifier from pointer target type#783

Open
heitbaum wants to merge 1 commit intovmware:masterfrom
heitbaum:glibc-2.43
Open

fix initialization discards 'const' qualifier from pointer target type#783
heitbaum wants to merge 1 commit intovmware:masterfrom
heitbaum:glibc-2.43

Conversation

@heitbaum
Copy link

Since glibc-2.43:

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.

https://lists.gnu.org/archive/html/info-gnu/2026-01/msg00005.html

Since glibc-2.43:

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.

https://lists.gnu.org/archive/html/info-gnu/2026-01/msg00005.html

Signed-off-by: Rudi Heitbaum <rudi@heitbaum.com>
@simpoir
Copy link

simpoir commented Mar 5, 2026

+1 Your patch looked identical to the one I came with, before I realized this PR exists.
Tested on ubuntu 26.04 with glibc-2.43 rebased against 2:13.0.10-1 and this fixes the compile issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Build against glibc-2.43 fails due to -Werror=discarded-qualifiers

2 participants