]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
bfd: fix build with C23
authorGuinevere Larsen <blarsen@redhat.com>
Fri, 5 Dec 2025 18:55:38 +0000 (15:55 -0300)
committerGuinevere Larsen <guinevere@redhat.com>
Mon, 8 Dec 2025 11:46:11 +0000 (08:46 -0300)
commit919ba8ce158eca9dd91c0d8181a541437fd39ff2
tree0d80a2a9d170cd8493b0ab6cc4d8c5591b3c69e9
parentb8524f61e398072f83938fb805f377f22198f9a9
bfd: fix build with C23

Starting in C23, strchr and strrchr will return const char *, if fed a
const char *.  This means that several files in the BFD directory will
fail to build as they are assigning the return of those functions to a
char *.

Fix this by const-ifying several variables. The only place where that
wasn't just that was in targets.c, where a variable was being used in
subsequent strrchr invocations to change the underlying string, so a new
variable had to be introduced.

No user-visible change should happen after this commit.
bfd/bfd.c
bfd/elflink.c
bfd/targets.c