On 06/30/2016 04:15 PM, Paolo Bonzini wrote:
> 
> 
> ----- Original Message -----
>> From: "John Snow" <[email protected]>
>> To: [email protected]
>> Cc: [email protected], [email protected], [email protected], "peter 
>> maydell" <[email protected]>,
>> "John Snow" <[email protected]>
>> 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 <[email protected]>
> 
> 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