Received: from eggs.gnu.org ([2001:4830:134:3::10]:56533) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bX2Cg-00006N-M8 for qemu-devel@nongnu.org; Tue, 09 Aug 2016 04:16:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bX2Cb-0003RV-KC for qemu-devel@nongnu.org; Tue, 09 Aug 2016 04:16:01 -0400 Received: from mail-wm0-x233.google.com ([2a00:1450:400c:c09::233]:35545) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bX2Cb-0003RP-Cq for qemu-devel@nongnu.org; Tue, 09 Aug 2016 04:15:57 -0400 Received: by mail-wm0-x233.google.com with SMTP id f65so17978756wmi.0 for ; Tue, 09 Aug 2016 01:15:57 -0700 (PDT) Sender: Paolo Bonzini References: <20160809023545.30204-1-bobby.prani@gmail.com> From: Paolo Bonzini Message-ID: <4bbde3b0-d17a-e1a3-1957-432c6ae3bff2@redhat.com> Date: Tue, 9 Aug 2016 10:15:53 +0200 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit 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 , Pranith Kumar Cc: Stefano Stabellini , "open list:All patches CC here" , =?UTF-8?Q?Marc-Andr=c3=a9_Lureau?= On 09/08/2016 10:09, 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 that was my first suggestion yesterday. However, we use -Wundef (a good idea, I think), and fixing it would cause the -Wundef warning to appear instead. Paolo