]> git.feebdaed.xyz Git - 0xmirror/qemu.git/commit
tests/vhost-user-bridge.c: Fix const qualifier build errors with recent glibc
authorCédric Le Goater <clg@redhat.com>
Mon, 15 Dec 2025 10:19:35 +0000 (11:19 +0100)
committerCédric Le Goater <clg@redhat.com>
Tue, 16 Dec 2025 13:28:30 +0000 (14:28 +0100)
commite37a0d514a17a660434ea20c0dd84bc6c20ca517
treeb87e7105ecbd6761fb69c30d38e1cd5356234a71
parent2f5c96d53409160b11f031b22f2d947f75ab06ab
tests/vhost-user-bridge.c: 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 :

../tests/vhost-user-bridge.c: In function ‘vubr_parse_host_port’:
../tests/vhost-user-bridge.c:749:15: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
  749 |     char *p = strchr(buf, ':');
      |               ^~~~~~

Fix this by using the glib g_strsplit() routine instead of strdup().

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

Suggested-by: Peter Maydell <peter.maydell@linaro.org>
Acked-by: Yodel Eldar <yodel.eldar@yodel.dev>
Tested-by: Yodel Eldar <yodel.eldar@yodel.dev>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20251215101937.281722-3-clg@redhat.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
tests/vhost-user-bridge.c