From: Felipe Franciosi Date: Thu, 2 Mar 2017 18:25:50 +0000 (-0800) Subject: libvhost-user: replace vasprintf() to fix build X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=eae0f543341b311038fa2d40350688c646880082;p=qemu.git libvhost-user: replace vasprintf() to fix build On gcc 3.4 and newer, simply using (void) in front of WUR functions is not sufficient to ignore the return value. That prevents a build when handling warnings as errors. libvhost-user had a usage of (void)vasprintf() which triggered such a condition. This fixes it by replacing this call with g_strdup_vprintf() which aborts on OOM. Signed-off-by: Felipe Franciosi Message-Id: <1488479153-21203-2-git-send-email-felipe@nutanix.com> Reviewed-by: Eric Blake --- diff --git a/contrib/libvhost-user/libvhost-user.c b/contrib/libvhost-user/libvhost-user.c index af4faad60b..61e1657e41 100644 --- a/contrib/libvhost-user/libvhost-user.c +++ b/contrib/libvhost-user/libvhost-user.c @@ -81,7 +81,7 @@ vu_panic(VuDev *dev, const char *msg, ...) va_list ap; va_start(ap, msg); - (void)vasprintf(&buf, msg, ap); + buf = g_strdup_vprintf(msg, ap); va_end(ap); dev->broken = true;