Skip to content

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

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

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

Conversation

@heitbaum

Copy link
Copy Markdown

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

simpoir commented Mar 5, 2026

Copy link
Copy Markdown

+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.

@Itxaka

Itxaka commented May 26, 2026

Copy link
Copy Markdown

+1 got the same issue building it locally, this fixes it

@heitbaum

Copy link
Copy Markdown
Author

@pngzhencao-bc any progress on having this merged?

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

3 participants