Received: from eggs.gnu.org ([2001:4830:134:3::10]:46594) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bX1PP-0003Kx-Rp for qemu-devel@nongnu.org; Tue, 09 Aug 2016 03:25:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bX1PJ-0001qk-TS for qemu-devel@nongnu.org; Tue, 09 Aug 2016 03:25:06 -0400 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]:35155) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bX1PJ-0001qH-M2 for qemu-devel@nongnu.org; Tue, 09 Aug 2016 03:25:01 -0400 Received: by mail-wm0-x242.google.com with SMTP id i5so1354895wmg.2 for ; Tue, 09 Aug 2016 00:25:01 -0700 (PDT) Sender: Paolo Bonzini References: <20160809023545.30204-1-bobby.prani@gmail.com> From: Paolo Bonzini Message-ID: Date: Tue, 9 Aug 2016 09:24:57 +0200 MIME-Version: 1.0 In-Reply-To: <20160809023545.30204-1-bobby.prani@gmail.com> 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: Pranith Kumar , "Daniel P. Berrange" , Peter Maydell , =?UTF-8?Q?Marc-Andr=c3=a9_Lureau?= , Stefano Stabellini , "open list:All patches CC here" On 09/08/2016 04: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)) > > Signed-off-by: Pranith Kumar > --- > configure | 13 +++++++++++++ > 1 file changed, 13 insertions(+) > > diff --git a/configure b/configure > index f57fcc6..a1a6e3f 100755 > --- a/configure > +++ b/configure > @@ -3025,6 +3025,19 @@ if ! compile_prog "$glib_cflags -Werror" "$glib_libs" ; then > fi > fi > > +# Silence clang warnings about expansion to 'defined' in macro > +cat > $TMPC << EOF > +#define TEST (defined(DUMMY)) > +#if TEST > +int main(void) { return 0; } > +#endif > +EOF > +if ! compile_prog "-Werror" ; then > + if cc_has_warning_flag "-Wno-expansion-to-defined"; then > + CFLAGS="-Wno-expansion-to-defined $CFLAGS" > + fi > +fi > + > ########################################## > # SHA command probe for modules > if test "$modules" = yes; then > Can you just add it to gcc_flags instead? Thanks, Paolo