On 12/10/25 19:14, Cédric Le Goater wrote:
On 12/10/25 19:13, 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 :

../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 <[email protected]>
Signed-off-by: Cédric Le Goater <[email protected]>
---
  tests/vhost-user-bridge.c | 10 ++++------
  1 file changed, 4 insertions(+), 6 deletions(-)

I should have added 'Not Tested' !

It seems to be going well:


$ build/tests/vhost-user-bridge -l 127.0.0.1:1234 -r 127.0.0.1:4321
ud socket: /tmp/vubr.sock (server)
local:     127.0.0.1:1234
remote:    127.0.0.1:4321
Waiting for connections on UNIX socket /tmp/vubr.sock ...
Added sock 3 for watching. max_sock: 3
Added sock 4 for watching. max_sock: 4
Waiting for data from udp backend on 127.0.0.1:1234...


C.


Reply via email to