]> git.feebdaed.xyz Git - 0xmirror/qemu.git/commit
gdbstub: Fix const qualifier build errors with recent glibc
authorCédric Le Goater <clg@redhat.com>
Mon, 15 Dec 2025 10:19:37 +0000 (11:19 +0100)
committerCédric Le Goater <clg@redhat.com>
Tue, 16 Dec 2025 13:28:30 +0000 (14:28 +0100)
commitd7e1df769910da9d832dda86b01fe1363e4f4a3c
tree4676868bffc7b605b4f03d1e7f3e0b72d3ec9f2d
parentdfe87815ba450228811f3abc633d7dc02757922e
gdbstub: Fix const qualifier build errors with recent glibc

A recent change in glibc 2.42.9000 [1] changes the return type of
strstr() and other string functions to be 'const char *' when the
input is a 'const char *'. This breaks the build in :

../gdbstub/user.c:322:21: error: assignment discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
  322 |     pid_placeholder = strstr(path, "%d");
      |                     ^
Fix this by changing the type of the variables that store the result
of these functions to 'const char *'.

[1] https://sourceware.org/git/?p=glibc.git;a=commit;h=cd748a63ab1a7ae846175c532a3daab341c62690

Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Link: https://lore.kernel.org/qemu-devel/20251215101937.281722-5-clg@redhat.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
gdbstub/user.c