On 06/30/2016 04:15 PM, Paolo Bonzini wrote:
> 
> 
> ----- Original Message -----
>> From: "John Snow" <js...@redhat.com>
>> To: qemu-devel@nongnu.org
>> Cc: qemu-triv...@nongnu.org, pbonz...@redhat.com, kra...@redhat.com, "peter 
>> maydell" <peter.mayd...@linaro.org>,
>> "John Snow" <js...@redhat.com>
>> Sent: Thursday, June 30, 2016 9:36:36 PM
>> Subject: [PATCH] Remove left shifts of negative signed integers
>>
>> Another exercise in placating Clang's increasingly strict -Werror mode.
>> Technically, this is undefined behavior. In practice, -N<<M is the same
>> as -(N<<M).
>>
>> Signed-off-by: John Snow <js...@redhat.com>
> 
> There's been discussions on this in the past; sorry but this is a
> super-duper NACK.
> 
> GCC correctly puts this warning under -Wextra, and promises not to ever
> make use of this facet of undefined behavior.  The only correct patch
> is the one that disables the warning for clang, and possibly adds
> -fwrapv.  In GCC, -fwrapv correctly silences ubsan's left-shift
> and signed-overflow warnings.  In Clang, this is reported at
> https://llvm.org/bugs/show_bug.cgi?id=25552.  It's a heavy hammer
> but it's the safest options as compiler evolve.
> 
> Paolo
> 

Where /exactly/ do you propose we canonicalize the clang invocation you
would like to support?

--js

Reply via email to