qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Alex Bennée" <alex.bennee@linaro.org>
To: Richard Henderson <richard.henderson@linaro.org>
Cc: "Thomas Huth" <thuth@redhat.com>,
	"Philippe Mathieu-Daudé" <philmd@redhat.com>,
	qemu-devel@nongnu.org
Subject: Re: [PATCH v3 1/5] fpu/softfloat: Silence 'bitwise negation of boolean expression' warning
Date: Wed, 17 Jun 2020 11:37:43 +0100	[thread overview]
Message-ID: <87pn9yx9jc.fsf@linaro.org> (raw)
In-Reply-To: <20200617043757.1623337-2-richard.henderson@linaro.org>


Richard Henderson <richard.henderson@linaro.org> writes:

> From: Philippe Mathieu-Daudé <philmd@redhat.com>
>
> When building with clang version 10.0.0-4ubuntu1, we get:
>
>     CC      lm32-softmmu/fpu/softfloat.o
>   fpu/softfloat.c:3365:13: error: bitwise negation of a boolean expression; did you mean logical negation? [-Werror,-Wbool-operation]
>       absZ &= ~ ( ( ( roundBits ^ 0x40 ) == 0 ) & roundNearestEven );
>               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
>   fpu/softfloat.c:3423:18: error: bitwise negation of a boolean expression; did you mean logical negation? [-Werror,-Wbool-operation]
>           absZ0 &= ~ ( ( (uint64_t) ( absZ1<<1 ) == 0 ) & roundNearestEven );
>                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
>   ...
>
>   fpu/softfloat.c:4273:18: error: bitwise negation of a boolean expression; did you mean logical negation? [-Werror,-Wbool-operation]
>           zSig1 &= ~ ( ( zSig2 + zSig2 == 0 ) & roundNearestEven );
>                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> Fix by rewriting the fishy bitwise AND of two bools as an int.
>
> Suggested-by: Eric Blake <eblake@redhat.com>
> Buglink: https://bugs.launchpad.net/bugs/1881004
> Reviewed-by: Thomas Huth <thuth@redhat.com>
> Reviewed-by: Eric Blake <eblake@redhat.com>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> Message-Id: <20200528155420.9802-1-philmd@redhat.com>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>

-- 
Alex Bennée


  reply	other threads:[~2020-06-17 10:38 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-17  4:37 [PATCH v3 0/5] Vs clang-10 and gcc-9 warnings Richard Henderson
2020-06-17  4:37 ` [PATCH v3 1/5] fpu/softfloat: Silence 'bitwise negation of boolean expression' warning Richard Henderson
2020-06-17 10:37   ` Alex Bennée [this message]
2020-06-17  4:37 ` [PATCH v3 2/5] migration: fix xbzrle encoding rate calculation Richard Henderson
2020-06-17 10:25   ` Philippe Mathieu-Daudé
2020-06-17 10:54   ` Alex Bennée
2020-06-17  4:37 ` [PATCH v3 3/5] configure: Clean up warning flag lists Richard Henderson
2020-06-17  7:11   ` Philippe Mathieu-Daudé
2020-06-17 10:56   ` Alex Bennée
2020-06-17  4:37 ` [PATCH v3 4/5] configure: Disable -Wtautological-type-limit-compare Richard Henderson
2020-06-17  4:37 ` [PATCH v3 5/5] configure: Add -Wno-psabi Richard Henderson
2020-06-17  6:50   ` Philippe Mathieu-Daudé
2020-06-17  7:10     ` Philippe Mathieu-Daudé
2020-06-17 11:02   ` Alex Bennée
2020-06-17  5:15 ` [PATCH v3 0/5] Vs clang-10 and gcc-9 warnings no-reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87pn9yx9jc.fsf@linaro.org \
    --to=alex.bennee@linaro.org \
    --cc=philmd@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).