All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Daniel P. Berrange" <berrange@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: "Pranith Kumar" <bobby.prani@gmail.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>,
	"Stefano Stabellini" <stefano.stabellini@eu.citrix.com>,
	"open list:All patches CC here" <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH] clang: Disable warning about expansion to 'defined'
Date: Tue, 9 Aug 2016 09:13:31 +0100	[thread overview]
Message-ID: <20160809081331.GC1530@redhat.com> (raw)
In-Reply-To: <CAFEAcA8U30vhKw4VQFSuMk9eKUJhL26Mb14pZiekKyaxuddZTg@mail.gmail.com>

On Tue, Aug 09, 2016 at 09:09:13AM +0100, Peter Maydell wrote:
> On 9 August 2016 at 03:35, Pranith Kumar <bobby.prani@gmail.com> wrote:
> > Clang produces the following warning. The warning is detailed here:
> > https://reviews.llvm.org/D15866. Disable the warning.
> >
> > /home/pranith/devops/code/qemu/hw/display/qxl.c:507:5: warning: macro expansion producing 'defined' has undefined behavior [-Wexpansion-to-defined]
> > #if SPICE_NEEDS_SET_MM_TIME
> >     ^
> > /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]
> > #if SPICE_NEEDS_SET_MM_TIME
> >     ^
> > /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))
> 
> Is this the only thing in our code which provokes the warning?
> If so, why don't we just fix it to not be undefined behaviour?

Indeed, it looks like it could be fixed by changing include/ui/qemu-spice.h


#define SPICE_NEEDS_SET_MM_TIME                                       \
  (!defined(SPICE_SERVER_VERSION) || (SPICE_SERVER_VERSION < 0xc06))


to be

#if !defined(SPICE_SERVER_VERSION) || (SPICE_SERVER_VERSION < 0xc06)
#define SPICE_NEEDS_SET_MM_TIME
#endif


Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

  reply	other threads:[~2016-08-09  8:13 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-09  2:35 [Qemu-devel] [PATCH] clang: Disable warning about expansion to 'defined' Pranith Kumar
2016-08-09  7:24 ` Paolo Bonzini
2016-08-09  8:09 ` Peter Maydell
2016-08-09  8:13   ` Daniel P. Berrange [this message]
2016-08-09  8:15   ` Paolo Bonzini
2016-08-09  8:17     ` Peter Maydell
2016-08-09  9:26       ` Paolo Bonzini
2016-08-09 16:38       ` Pranith Kumar

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=20160809081331.GC1530@redhat.com \
    --to=berrange@redhat.com \
    --cc=bobby.prani@gmail.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefano.stabellini@eu.citrix.com \
    /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.