qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] configure: disable -Wxor-used-as-pow


From: Paolo Bonzini
Subject: Re: [PATCH] configure: disable -Wxor-used-as-pow
Date: Tue, 23 Jun 2020 21:53:30 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0

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 via email to

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