From patchwork Thu Mar 2 18:25:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Franciosi X-Patchwork-Id: 734721 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3vZ14K0Gl4z9s7F for ; Fri, 3 Mar 2017 05:26:53 +1100 (AEDT) Received: from localhost ([::1]:53894 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cjVRB-0005CZ-Op for incoming@patchwork.ozlabs.org; Thu, 02 Mar 2017 13:26:49 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36636) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cjVQQ-0005CJ-VH for qemu-devel@nongnu.org; Thu, 02 Mar 2017 13:26:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cjVQM-0005St-8g for qemu-devel@nongnu.org; Thu, 02 Mar 2017 13:26:03 -0500 Received: from 206-15-90-246.static.twtelecom.net ([206.15.90.246]:13749 helo=felipe-franciosi.localdomain) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cjVQM-0005SS-20 for qemu-devel@nongnu.org; Thu, 02 Mar 2017 13:25:58 -0500 Received: by felipe-franciosi.localdomain (Postfix, from userid 500) id A860010688B; Thu, 2 Mar 2017 10:25:56 -0800 (PST) From: Felipe Franciosi To: Paolo Bonzini , Stefan Hajnoczi , Marc-Andre Lureau , "Michael S. Tsirkin" Date: Thu, 2 Mar 2017 10:25:50 -0800 Message-Id: <1488479153-21203-2-git-send-email-felipe@nutanix.com> X-Mailer: git-send-email 1.9.4 In-Reply-To: <1488479153-21203-1-git-send-email-felipe@nutanix.com> References: <1488479153-21203-1-git-send-email-felipe@nutanix.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 206.15.90.246 Subject: [Qemu-devel] [PATCH v5 1/4] libvhost-user: replace vasprintf() to fix build X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "qemu-devel@nongnu.org" , Felipe Franciosi Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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 Reviewed-by: Eric Blake --- 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;