[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 for 2.5] QEMU does not care about left shifts
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PATCH v2 for 2.5] QEMU does not care about left shifts of signed negative values |
Date: |
Tue, 17 Nov 2015 18:40:22 +0000 |
On 17 November 2015 at 18:36, Paolo Bonzini <address@hidden> wrote:
> On 17/11/2015 19:24, Peter Maydell wrote:
>> But if "-fwrapv" means "this dialect of C makes shifts of
>> negative numbers well defined and OK" then "-1 << 31"
>> should be fine and should not provoke a warning (whether in
>> a constant expression or not). If that's not what -fwrapv means,
>> then we shouldn't be using it as if it did.
>
> Since we don't use -pedantic, we don't care.
We need to care because the interesting question is "what is
GCC guaranteeing to us", not "how can we shut the compiler up".
If -fwrapv doesn't silence these warnings that means there's
a disconnect between what we think the guarantees are and what
the gcc devs think the guarantees are, which is liable to
cause trouble in the future.
thanks
-- PMM
- Re: [Qemu-devel] [PATCH v2 for 2.5] QEMU does not care about left shifts of signed negative values, (continued)
Re: [Qemu-devel] [PATCH v2 for 2.5] QEMU does not care about left shifts of signed negative values, Markus Armbruster, 2015/11/17
Re: [Qemu-devel] [PATCH v2 for 2.5] QEMU does not care about left shifts of signed negative values, Markus Armbruster, 2015/11/17