All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pranith Kumar <bobby.prani@gmail.com>
To: Gerd Hoffmann <kraxel@redhat.com>,
	"open list:All patches CC here" <qemu-devel@nongnu.org>
Cc: pbonzini@redhat.com, peter.maydell@linaro.org
Subject: [Qemu-devel] [PATCH 4/5] clang: Fix warning reg. expansion to 'defined'
Date: Tue,  9 Aug 2016 15:02:27 -0400	[thread overview]
Message-ID: <20160809190229.27871-4-bobby.prani@gmail.com> (raw)
In-Reply-To: <20160809190229.27871-1-bobby.prani@gmail.com>

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 <peter.maydell@linaro.org>
Signed-off-by: Pranith Kumar <bobby.prani@gmail.com>
---
 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);
-- 
2.9.2

  parent reply	other threads:[~2016-08-09 19:02 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-09 19:02 [Qemu-devel] [PATCH 1/5] atomic: strip "const" from variables declared with typeof Pranith Kumar
2016-08-09 19:02 ` [Qemu-devel] [PATCH 2/5] softfloat: Fix warn about implicit conversion from int to int8_t Pranith Kumar
2016-08-09 19:16   ` Aurelien Jarno
2016-08-09 21:12     ` Peter Maydell
2016-08-10 12:27       ` Aurelien Jarno
2016-08-10 10:32   ` Richard Henderson
2016-08-10 10:37     ` Peter Maydell
2016-08-10 12:12       ` Paolo Bonzini
2016-08-09 19:02 ` [Qemu-devel] [PATCH 3/5] Disable warn about left shifts of negative values Pranith Kumar
2016-08-09 19:02 ` Pranith Kumar [this message]
2016-08-09 19:02 ` [Qemu-arm] [PATCH 5/5] target-arm: Fix warn about implicit conversion Pranith Kumar
2016-08-09 19:02   ` [Qemu-devel] " Pranith Kumar
2016-08-11 10:50   ` [Qemu-arm] " Peter Maydell
2016-08-11 10:50     ` [Qemu-devel] " Peter Maydell
2016-08-12 12:20     ` Peter Maydell
2016-08-12 12:20       ` Peter Maydell
2016-08-09 20:14 ` [Qemu-devel] [PATCH 1/5] atomic: strip "const" from variables declared with typeof Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160809190229.27871-4-bobby.prani@gmail.com \
    --to=bobby.prani@gmail.com \
    --cc=kraxel@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.