Re: [Qemu-devel] [PATCH] Remove left shifts of negative signed integers

2016-08-16 Thread Peter Maydell
On 30 June 2016 at 21:15, Paolo Bonzini wrote: > 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

Re: [Qemu-devel] [PATCH] Remove left shifts of negative signed integers

2016-06-30 Thread Paolo Bonzini
> > 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 si

Re: [Qemu-devel] [PATCH] Remove left shifts of negative signed integers

2016-06-30 Thread John Snow
On 06/30/2016 04:15 PM, Paolo Bonzini wrote: > > > - Original Message - >> From: "John Snow" >> To: qemu-devel@nongnu.org >> Cc: qemu-triv...@nongnu.org, pbonz...@redhat.com, kra...@redhat.com, "peter >> maydell" , >> "John Snow" >> Sent: Thursday, June 30, 2016 9:36:36 PM >> Subject

Re: [Qemu-devel] [PATCH] Remove left shifts of negative signed integers

2016-06-30 Thread Paolo Bonzini
> > We have been down this path before: > > http://patchwork.ozlabs.org/patch/545238/ > > > > Paolo will doubtless be along with the rant shortly. Here I am! Paolo > I figured, so I CC'd him. Nobody can say I didn't try. > > --js >

Re: [Qemu-devel] [PATCH] Remove left shifts of negative signed integers

2016-06-30 Thread Paolo Bonzini
- Original Message - > From: "John Snow" > To: qemu-devel@nongnu.org > Cc: qemu-triv...@nongnu.org, pbonz...@redhat.com, kra...@redhat.com, "peter > maydell" , > "John Snow" > Sent: Thursday, June 30, 2016 9:36:36 PM > Subject: [PATCH] Remove left shifts of negative signed integers >

Re: [Qemu-devel] [PATCH] Remove left shifts of negative signed integers

2016-06-30 Thread John Snow
On 06/30/2016 04:11 PM, Peter Maydell wrote: > On 30 June 2016 at 20:36, John Snow wrote: >> Another exercise in placating Clang's increasingly strict -Werror mode. >> Technically, this is undefined behavior. In practice, -N<> as -(N<> >> Signed-off-by: John Snow >> --- >> hw/audio/fmopl.c

Re: [Qemu-devel] [PATCH] Remove left shifts of negative signed integers

2016-06-30 Thread Peter Maydell
On 30 June 2016 at 20:36, John Snow wrote: > Another exercise in placating Clang's increasingly strict -Werror mode. > Technically, this is undefined behavior. In practice, -N< as -(N< > Signed-off-by: John Snow > --- > hw/audio/fmopl.c | 2 +- > target-i386/monitor.c | 2 +- > 2 files chan

[Qemu-devel] [PATCH] Remove left shifts of negative signed integers

2016-06-30 Thread John Snow
Another exercise in placating Clang's increasingly strict -Werror mode. Technically, this is undefined behavior. In practice, -N< --- hw/audio/fmopl.c | 2 +- target-i386/monitor.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/audio/fmopl.c b/hw/audio/fmopl.c index