From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56114) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bX2AO-00074j-Kt for qemu-devel@nongnu.org; Tue, 09 Aug 2016 04:13:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bX2AJ-0002ux-SY for qemu-devel@nongnu.org; Tue, 09 Aug 2016 04:13:39 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40448) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bX2AJ-0002ua-Mj for qemu-devel@nongnu.org; Tue, 09 Aug 2016 04:13:35 -0400 Date: Tue, 9 Aug 2016 09:13:31 +0100 From: "Daniel P. Berrange" Message-ID: <20160809081331.GC1530@redhat.com> Reply-To: "Daniel P. Berrange" References: <20160809023545.30204-1-bobby.prani@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PATCH] clang: Disable warning about expansion to 'defined' List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Pranith Kumar , Paolo Bonzini , =?utf-8?Q?Marc-Andr=C3=A9?= Lureau , Stefano Stabellini , "open list:All patches CC here" On Tue, Aug 09, 2016 at 09:09:13AM +0100, Peter Maydell wrote: > On 9 August 2016 at 03:35, Pranith Kumar 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 :|