On 12/10/25 11:35, Michael Tokarev wrote:
On 12/9/25 20:43, Cédric Le Goater wrote:
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
I'm picking this up for qemu-stable (10.0 & 10.1 series)
(together with 83f6dceb8f5c "qga: Fix ubsan warning").
Please let me know if I shouldn't.
This is a partial fix for the recent glibc update. We need at least
two other patches. One rewriting vubr_parse_host_port() as Peter
proposed and another for :
../hw/i386/x86-common.c:827:11: error: assignment discards ‘const’ qualifier
from pointer target type [-Werror=discarded-qualifiers]
827 | vmode = strstr(kernel_cmdline, "vga=");
which is missing in v3.
Anyhow, there is no harm in taking this first part. Future backports
should be simple enough.
Thanks,
C.