[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v5 1/4] libvhost-user: replace vasprintf() to fix bu
From: |
Felipe Franciosi |
Subject: |
[Qemu-devel] [PATCH v5 1/4] libvhost-user: replace vasprintf() to fix build |
Date: |
Thu, 2 Mar 2017 10:25:50 -0800 |
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 <address@hidden>
---
contrib/libvhost-user/libvhost-user.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/contrib/libvhost-user/libvhost-user.c
b/contrib/libvhost-user/libvhost-user.c
index af4faad..61e1657 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;
--
1.9.4
- [Qemu-devel] [PATCH v5 0/4] Introduce vhost-user-scsi and sample application, Felipe Franciosi, 2017/03/02
- [Qemu-devel] [PATCH v5 1/4] libvhost-user: replace vasprintf() to fix build,
Felipe Franciosi <=
- [Qemu-devel] [PATCH v5 4/4] vus: Introduce a vhost-user-scsi sample application, Felipe Franciosi, 2017/03/02
- [Qemu-devel] [PATCH v5 3/4] vus: Introduce vhost-user-scsi host device, Felipe Franciosi, 2017/03/02
- [Qemu-devel] [PATCH v5 2/4] vhost-scsi: create a vhost-scsi-common abstraction, Felipe Franciosi, 2017/03/02
- Re: [Qemu-devel] [PATCH v5 0/4] Introduce vhost-user-scsi and sample application, no-reply, 2017/03/02
- Re: [Qemu-devel] [PATCH v5 0/4] Introduce vhost-user-scsi and sample application, no-reply, 2017/03/02
- Re: [Qemu-devel] [PATCH v5 0/4] Introduce vhost-user-scsi and sample application, no-reply, 2017/03/02
- Re: [Qemu-devel] [PATCH v5 0/4] Introduce vhost-user-scsi and sample application, Michael S. Tsirkin, 2017/03/02