]> git.feebdaed.xyz Git - 0xmirror/qemu.git/commit
Fix const qualifier build errors with recent glibc
authorCédric Le Goater <clg@redhat.com>
Tue, 9 Dec 2025 17:43:28 +0000 (18:43 +0100)
committerPhilippe Mathieu-Daudé <philmd@linaro.org>
Tue, 9 Dec 2025 20:00:15 +0000 (21:00 +0100)
commit326e620fc0145686124f754194cdc6d0d9b3400d
treeb0bc8ab030592b4c3874a1d38105637e96fda0ec
parente742b7bdc244499761a21bc1965580c6261a74bf
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 various files with errors such as :

  error: initialization discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
    208 |         char *pidstr = strstr(filename, "%");
        |                        ^~~~~~

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

Signed-off-by: Cédric Le Goater <clg@redhat.com>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20251209174328.698774-1-clg@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
backends/tpm/tpm_passthrough.c
block/vmdk.c
block/vvfat.c
gdbstub/gdbstub.c
qga/commands-linux.c
ui/ui-hmp-cmds.c
util/log.c