From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:51183) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S5hl4-0005bw-4m for qemu-devel@nongnu.org; Thu, 08 Mar 2012 13:08:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S5hky-0006R0-21 for qemu-devel@nongnu.org; Thu, 08 Mar 2012 13:08:09 -0500 Sender: Paolo Bonzini Message-ID: <4F58F563.1020107@redhat.com> Date: Thu, 08 Mar 2012 19:07:31 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1330176948-14379-1-git-send-email-sw@weilnetz.de> <4F58D961.70706@redhat.com> <4F58DD6F.8080907@codemonkey.ws> In-Reply-To: <4F58DD6F.8080907@codemonkey.ws> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] vnc: Fix packed boolean struct members List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: QEMU Trivial , Stefan Hajnoczi , Anthony Liguori , qemu-devel@nongnu.org, Stefan Weil Il 08/03/2012 17:25, Anthony Liguori ha scritto: >> >> 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? Nothing, it's just that if "y = 0" is an int (for some reason, I didn't check if it's implicit promotion or just that y is already an int), then it has to be converted back to a truth value before assigning to bool. If you do bool x; int y; x = y = 2; x is actually set to 1. Paolo