From patchwork Tue Aug 9 19:02:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pranith Kumar X-Patchwork-Id: 9272075 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 6885A6075A for ; Tue, 9 Aug 2016 19:06:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 54A4B2833A for ; Tue, 9 Aug 2016 19:06:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 497C1283DF; Tue, 9 Aug 2016 19:06:15 +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.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID 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 DA93D2833A for ; Tue, 9 Aug 2016 19:06:14 +0000 (UTC) Received: from localhost ([::1]:37537 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bXCLt-0002JZ-Fx for patchwork-qemu-devel@patchwork.kernel.org; Tue, 09 Aug 2016 15:06:13 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36281) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bXCIO-0007gD-VZ for qemu-devel@nongnu.org; Tue, 09 Aug 2016 15:02:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bXCIM-0002gz-OA for qemu-devel@nongnu.org; Tue, 09 Aug 2016 15:02:35 -0400 Received: from mail-yw0-x243.google.com ([2607:f8b0:4002:c05::243]:35119) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bXCIM-0002gq-KA for qemu-devel@nongnu.org; Tue, 09 Aug 2016 15:02:34 -0400 Received: by mail-yw0-x243.google.com with SMTP id r9so912695ywg.2 for ; Tue, 09 Aug 2016 12:02:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=du1Tgn/ZizEc+k4EdRL8XvCLGbhR8XDAhoXQhJGZcnQ=; b=NC0PJe2PXkerRNem+uCN9yJiv1m71h4WK6AzjeF4tuPVqBc/w5GIM7Nh7Uz0ZNti5/ jpkBOKBh4JgyxXGJMvISDcfr8hDBBZYDtKqM16NEKbLs02j9zkqY9w5+I8uw/Ey902aA 2tGWq+Y38vrLfulh32Z4wVT1tkJ9YxlZu0a5PILbQOUeKkTywCjQX9p8KE/YlY+lCpG7 qIYYdlddZznH4ZZhd2/bmqd6Nklul6KtaKi1ZwoZm8zVseVvI78TaIYdNHVUzvcsrgwR u4oiprA6oz2YYbbEQGLjG3Q1cZLVnjNdS/VeLl2FGZ0nMdplhYkwI3/9sTet0PkiVFMW QYYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=du1Tgn/ZizEc+k4EdRL8XvCLGbhR8XDAhoXQhJGZcnQ=; b=Jq+Hexg3Dnr1kK53V8L3vwOX1CIEqqb33mCpIhSWrlKEpszjGP8RSa/tDWU9pkxH+s Gy5swOEHPyEwHKQptBTxU675Sz2S4lw5uZG2HurIjpX2b/h/yMuORUIaDZzojtfdEe7A qZpKOK6Ix/nnMr4/eMGOK3/C3YGPYy0ZX6S9CicvEQZDc+wWO6NJPFYQkLOb54OyaWvj cyA6rY7RPMAJMxVgNhVl3jpnO8qQmLSLH4G0/e+PNgTqJq84P2QIYwYXfar4BOLgEpQK GdNaeRoRrPSgXe8x9XkWclzv8nrLIo9jSQqMjbKOG+ORmT8s7F8U0nEc5Hxewv/F24Br d/bA== X-Gm-Message-State: AEkoouv4wIGV/VZ6YnlHYqT+XhdDV1cEJJwL1jT8uafH8MANW92CB4xDpsI2W5FXoiQ0Sw== X-Received: by 10.129.51.215 with SMTP id z206mr73081637ywz.251.1470769354155; Tue, 09 Aug 2016 12:02:34 -0700 (PDT) Received: from evgadesktop.attlocal.net (108-232-152-155.lightspeed.tukrga.sbcglobal.net. [108.232.152.155]) by smtp.gmail.com with ESMTPSA id t67sm16659070ywa.33.2016.08.09.12.02.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 09 Aug 2016 12:02:33 -0700 (PDT) From: Pranith Kumar To: Gerd Hoffmann , qemu-devel@nongnu.org (open list:All patches CC here) Date: Tue, 9 Aug 2016 15:02:27 -0400 Message-Id: <20160809190229.27871-4-bobby.prani@gmail.com> X-Mailer: git-send-email 2.9.2 In-Reply-To: <20160809190229.27871-1-bobby.prani@gmail.com> References: <20160809190229.27871-1-bobby.prani@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:4002:c05::243 Subject: [Qemu-devel] [PATCH 4/5] clang: Fix warning reg. expansion to 'defined' 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: pbonzini@redhat.com, qemu-devel@nongnu.org, peter.maydell@linaro.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Clang produces the following warning. The warning is detailed here: https://reviews.llvm.org/D15866. Fix the warning. /home/pranith/devops/code/qemu/hw/display/qxl.c:507:5: warning: macro expansion producing 'defined' has undefined behavior [-Wexpansion-to-defined] ^ /home/pranith/devops/code/qemu/include/ui/qemu-spice.h:46:5: note: expanded from macro 'SPICE_NEEDS_SET_MM_TIME' (!defined(SPICE_SERVER_VERSION) || (SPICE_SERVER_VERSION < 0xc06)) ^ /home/pranith/devops/code/qemu/hw/display/qxl.c:1074:5: warning: macro expansion producing 'defined' has undefined behavior [-Wexpansion-to-defined] ^ /home/pranith/devops/code/qemu/include/ui/qemu-spice.h:46:5: note: expanded from macro 'SPICE_NEEDS_SET_MM_TIME' (!defined(SPICE_SERVER_VERSION) || (SPICE_SERVER_VERSION < 0xc06)) Suggested-by: Peter Maydell Signed-off-by: Pranith Kumar --- include/ui/qemu-spice.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/include/ui/qemu-spice.h b/include/ui/qemu-spice.h index edad5e7..75e1239 100644 --- a/include/ui/qemu-spice.h +++ b/include/ui/qemu-spice.h @@ -42,8 +42,11 @@ int qemu_spice_set_pw_expire(time_t expires); int qemu_spice_migrate_info(const char *hostname, int port, int tls_port, const char *subject); -#define SPICE_NEEDS_SET_MM_TIME \ - (!defined(SPICE_SERVER_VERSION) || (SPICE_SERVER_VERSION < 0xc06)) +#if !defined(SPICE_SERVER_VERSION) || (SPICE_SERVER_VERSION < 0xc06) +#define SPICE_NEEDS_SET_MM_TIME 1 +#else +#define SPICE_NEEDS_SET_MM_TIME 0 +#endif #if SPICE_SERVER_VERSION >= 0x000c02 void qemu_spice_register_ports(void);