Re: Fix a warning with gcc 15 and glibc 2.43

Gavin Smith <[email protected]>
Newsgroups gmane.comp.tex.texinfo.bugs
Message-ID <aXXbeAmlCQNl5KHS@orangestar>
On Sun, Jan 25, 2026 at 02:36:07AM +0100, Bruno Haible via Bug reports for the GNU Texinfo documentation system wrote:
> Building texinfo-7.2.90 with gcc 15.2.0 and glibc 2.43 (that was released
> yesterday), I see a warning:
> 
> ../../install-info/install-info.c:1605:15: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
> 
> The cause is this change in glibc [1]:
>   * 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.
> 
> Here, ISO C 23 wants 'ptr' to be a 'const char *', not a 'char *'.
> And with it, 'endptr' must be of the same type as well.
> 
> Find attached a proposed patch. I have verified that it fixes the warning.
> 
> [1] https://lists.gnu.org/archive/html/info-gnu/2026-01/msg00005.html

Thank makes sense, thanks for the report.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.