From patchwork Fri Jan 11 16:35:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 10760287 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7CF6013B4 for ; Fri, 11 Jan 2019 16:37:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 698B12A081 for ; Fri, 11 Jan 2019 16:37:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5D48E2A0AF; Fri, 11 Jan 2019 16:37:07 +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=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0B6372A081 for ; Fri, 11 Jan 2019 16:37:07 +0000 (UTC) Received: from localhost ([127.0.0.1]:40594 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ghznu-00038g-E5 for patchwork-qemu-devel@patchwork.kernel.org; Fri, 11 Jan 2019 11:37:06 -0500 Received: from eggs.gnu.org ([209.51.188.92]:54289) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ghzmQ-00028n-LS for qemu-devel@nongnu.org; Fri, 11 Jan 2019 11:35:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ghzmP-0004qh-Qh for qemu-devel@nongnu.org; Fri, 11 Jan 2019 11:35:34 -0500 Received: from mx1.redhat.com ([209.132.183.28]:49810) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ghzmK-0004ko-RW; Fri, 11 Jan 2019 11:35:29 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AF2F8C78FA; Fri, 11 Jan 2019 16:35:27 +0000 (UTC) Received: from x1w.redhat.com (ovpn-204-102.brq.redhat.com [10.40.204.102]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 000845D6B3; Fri, 11 Jan 2019 16:35:21 +0000 (UTC) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Date: Fri, 11 Jan 2019 17:35:19 +0100 Message-Id: <20190111163519.11457-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Fri, 11 Jan 2019 16:35:27 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH] qemu-nbd: Rename 'exp' variable clashing with math::exp() symbol 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: Paolo Bonzini , Vladimir Sementsov-Ogievskiy , qemu-block@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP The use of a variable named 'exp' prevents includes to import . Rename it to avoid: qemu-nbd.c:64:19: error: ‘exp’ redeclared as different kind of symbol static NBDExport *exp; ^~~ In file included from /usr/include/features.h:428, from /usr/include/bits/libc-header-start.h:33, from /usr/include/stdint.h:26, from /usr/lib/gcc/x86_64-redhat-linux/8/include/stdint.h:9, from /source/qemu/include/qemu/osdep.h:80, from /source/qemu/qemu-nbd.c:19: /usr/include/bits/mathcalls.h:95:1: note: previous declaration of ‘exp’ was here __MATHCALL_VEC (exp,, (_Mdouble_ __x)); ^~~~~~~~~~~~~~ Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Eric Blake --- qemu-nbd.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/qemu-nbd.c b/qemu-nbd.c index 2807e13239..6ca02b6d87 100644 --- a/qemu-nbd.c +++ b/qemu-nbd.c @@ -61,7 +61,7 @@ #define MBR_SIZE 512 -static NBDExport *exp; +static NBDExport *export; static int verbose; static char *srcpath; static SocketAddress *saddr; @@ -335,7 +335,7 @@ static int nbd_can_accept(void) return state == RUNNING && nb_fds < shared; } -static void nbd_export_closed(NBDExport *exp) +static void nbd_export_closed(NBDExport *export) { assert(state == TERMINATING); state = TERMINATED; @@ -1015,10 +1015,11 @@ int main(int argc, char **argv) } } - exp = nbd_export_new(bs, dev_offset, fd_size, nbdflags, nbd_export_closed, - writethrough, NULL, &error_fatal); - nbd_export_set_name(exp, export_name); - nbd_export_set_description(exp, export_description); + export = nbd_export_new(bs, dev_offset, fd_size, nbdflags, + nbd_export_closed, writethrough, + NULL, &error_fatal); + nbd_export_set_name(export, export_name); + nbd_export_set_description(export, export_description); if (device) { #if HAVE_NBD_DEVICE @@ -1055,9 +1056,9 @@ int main(int argc, char **argv) main_loop_wait(false); if (state == TERMINATE) { state = TERMINATING; - nbd_export_close(exp); - nbd_export_put(exp); - exp = NULL; + nbd_export_close(export); + nbd_export_put(export); + export = NULL; } } while (state != TERMINATED);