Le 01/05/2019 à 01:28, Alistair Francis a écrit : > Fix this warning when building with GCC9 on Fedora 30: > In function ‘strncpy’, > inlined from ‘unix_connect_saddr.isra.0’ at util/qemu-sockets.c:925:5: > /usr/include/bits/string_fortified.h:106:10: error: ‘__builtin_strncpy’ > specified bound 108 equals destination size [-Werror=stringop-truncation] > 106 | return __builtin___strncpy_chk (__dest, __src, __len, __bos > (__dest)); > | > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > In function ‘strncpy’, > inlined from ‘unix_listen_saddr.isra.0’ at util/qemu-sockets.c:880:5: > > Signed-off-by: Alistair Francis <alistair.fran...@wdc.com> > --- > util/qemu-sockets.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/util/qemu-sockets.c b/util/qemu-sockets.c > index 9705051690..8c3322958f 100644 > --- a/util/qemu-sockets.c > +++ b/util/qemu-sockets.c > @@ -829,7 +829,7 @@ static int unix_listen_saddr(UnixSocketAddress *saddr, > struct sockaddr_un un; > int sock, fd; > char *pathbuf = NULL; > - const char *path; > + const char *path QEMU_NONSTRING;
Do we need this with memcpy()? Thanks, Laurent