qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Eric Blake <eblake@redhat.com>, qemu-devel@nongnu.org
Subject: Re: [PATCH] configure: disable -Wxor-used-as-pow
Date: Tue, 23 Jun 2020 21:53:30 +0200	[thread overview]
Message-ID: <e5cefdc7-b470-50a7-8c02-8f712d8f2c0c@redhat.com> (raw)
In-Reply-To: <cc8efdbc-0d09-37ca-199a-2b82700aea00@redhat.com>

On 23/06/20 20:41, Eric Blake wrote:
> On 6/23/20 12:37 PM, Paolo Bonzini wrote:
>> Clang being clang and adding more pointless warnings.  In a hardware
>> emulator there are going to be plenty of bitwise operations, and the
>> chance of someone writing ^ for pow and not being caught is basically
>> zero.
> 
> Did this warning actually fire?
> 
> My understanding (from a quick glance of
> https://reviews.llvm.org/D63423) is that it is supposed to catch
> instances of '2 ^ 16' where someone meant '1 << 16' instead of 18.  I
> don't know if it is supposed to flag 'a ^ 16' (if it does, then it is
> indeed useless), or only when both lhs and rhs are constants and where
> lhs is 2 or 10, so my initial reaction is that without seeing an actual
> false positive, we are premature in disabling it.

There is an instance of 2 ^ 20.

But it's actually a bug.  Objection (and faith in humanity) retracted.

Paolo



      reply	other threads:[~2020-06-23 19:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-23 17:37 [PATCH] configure: disable -Wxor-used-as-pow Paolo Bonzini
2020-06-23 18:41 ` Eric Blake
2020-06-23 19:53   ` Paolo Bonzini [this message]

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=e5cefdc7-b470-50a7-8c02-8f712d8f2c0c@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=eblake@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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).