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: 9601363 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E79A460414 for ; Thu, 2 Mar 2017 18:26:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DCB4F2858D for ; Thu, 2 Mar 2017 18:26:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CF919285D1; Thu, 2 Mar 2017 18:26:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3888E2858D for ; Thu, 2 Mar 2017 18:26:26 +0000 (UTC) Received: from localhost ([::1]:53894 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cjVQk-0005CZ-VH for patchwork-qemu-devel@patchwork.kernel.org; Thu, 02 Mar 2017 13:26:23 -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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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;