On 12 September 2016 at 18:06, Paolo Bonzini wrote:
>
>
> On 12/09/2016 15:10, Peter Maydell wrote:
>> QEMU's code relies on left shifts of signed integers always
>> being defined behaviour with the obvious 2s-complement
>> semantics. The only way to tell the compiler (and
On 12/09/2016 15:10, Peter Maydell wrote:
> QEMU's code relies on left shifts of signed integers always
> being defined behaviour with the obvious 2s-complement
> semantics. The only way to tell the compiler (and any
> associated undefined-behaviour sanitizer) that we require a
> C dialect with
On 12 September 2016 at 16:04, Markus Armbruster wrote:
> If I remember correctly, we discussed -fno-strict-overflow (which the
> kernel uses), but in the end opted for the more stringent -fwrapv.
Yep. -fno-strict-overflow just says "don't do bad things on
integer overflow
Peter Maydell writes:
> QEMU's code relies on left shifts of signed integers always
> being defined behaviour with the obvious 2s-complement
> semantics. The only way to tell the compiler (and any
> associated undefined-behaviour sanitizer) that we require a
> C dialect
QEMU's code relies on left shifts of signed integers always
being defined behaviour with the obvious 2s-complement
semantics. The only way to tell the compiler (and any
associated undefined-behaviour sanitizer) that we require a
C dialect with these semantics is to use the -fwrapv option.
This is