[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-trivial] [Qemu-devel] [PATCH] vnc: Fix packed boolean struct m

From: Anthony Liguori
Subject: Re: [Qemu-trivial] [Qemu-devel] [PATCH] vnc: Fix packed boolean struct members
Date: Thu, 08 Mar 2012 10:25:19 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20110922 Lightning/1.0b2 Thunderbird/3.1.15

On 03/08/2012 10:08 AM, Paolo Bonzini wrote:
Il 08/03/2012 16:26, Stefan Hajnoczi ha scritto:
I had to drop this patch from the trivial patches tree, it tickles a
new gcc warning.  Please resend with the necessary change.

I cannot reproduce it on my build host here with gcc Debian 4.6.2-12
but Anthony reports the following Ubuntu/Linaro 4.5.2-8ubuntu4:

   CC    ui/vnc-auth-sasl.o
cc1: warnings being treated as errors
/home/anthony/git/qemu/ui/vnc-auth-sasl.c: In function
/home/anthony/git/qemu/ui/vnc-auth-sasl.c:34:9: error: suggest
parentheses around assignment used as truth value
make: *** [ui/vnc-auth-sasl.o] Error 1

Looks like a GCC bug where

    x = y = 0;

is converted to

    x = (y = 0) != 0;

Curious, why convert like this?  What does this optimization do?


Anthony Liguori

and the magic that does this inside the compiler causes the warning.

We should add a configure check to only add -Werror on compilers newer
than X (for example X could leave out GCC 4.5), so that this patch can
be reapplied.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]