https://sourceware.org/bugzilla/show_bug.cgi?id=34125

--- Comment #4 from Sourceware Commits <cvs-commit at gcc dot gnu.org> ---
The binutils-2_46-branch branch has been updated by H.J. Lu
<[email protected]>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=922d530f0aa6973b92489e4c84a449bf09421b1f

commit 922d530f0aa6973b92489e4c84a449bf09421b1f
Author: Simon Marchi <[email protected]>
Date:   Fri Feb 13 14:17:40 2026 -0500

    binutils: fix C23 -Wdiscarded-qualifiers errors

    When compiling with gcc 15, I get these:

          CC       prdbg.o
        /home/simark/src/binutils-gdb/binutils/prdbg.c: In function
ââ¬Ëtg_start_functionââ¬â¢:
        /home/simark/src/binutils-gdb/binutils/prdbg.c:2658:11: error:
assignment discards ââ¬Ëconstââ¬â¢ qualifier from pointer target type
[-Werror=discarded-qualifiers]
         2658 |       sep = strchr (name, '(');
              |           ^
        cc1: all warnings being treated as errors
        make[2]: *** [Makefile:1220: prdbg.o] Error 1
          CC       addr2line.o
        /home/simark/src/binutils-gdb/binutils/addr2line.c: In function
ââ¬Ëtranslate_addressesââ¬â¢:
        /home/simark/src/binutils-gdb/binutils/addr2line.c:390:21: error:
assignment discards ââ¬Ëconstââ¬â¢ qualifier from pointer target type
[-Werror=discarded-qualifiers]
          390 |                   h = strrchr (filename, '/');
              |                     ^
        cc1: all warnings being treated as errors
        make[2]: *** [Makefile:1220: addr2line.o] Error 1
          CC       nm.o
        /home/simark/src/binutils-gdb/binutils/nm.c: In function
ââ¬Ëprint_symnameââ¬â¢:
        /home/simark/src/binutils-gdb/binutils/nm.c:689:21: error:
initialization discards ââ¬Ëconstââ¬â¢ qualifier from pointer target type
[-Werror=discarded-qualifiers]
          689 |       char *atver = strchr (name, '@');
              |                     ^~~~~~
        cc1: all warnings being treated as errors

    I think they are related to the fact that strchr having changed to
    return const when passed a const.

    This partially fixes PR binutils/34125.

    Change-Id: Idb829916378f0a18e717d1e80414aaa5eba4f7f0
    (cherry picked from commit 9cb12adfb54bc3dabf4ee00296064245eb7660ef)

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Reply via email to