[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PULL 00/40] ppc patch queue 2015-06-03
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PULL 00/40] ppc patch queue 2015-06-03 |
Date: |
Fri, 5 Jun 2015 16:45:46 +0100 |
On 5 June 2015 at 16:20, Paolo Bonzini <address@hidden> wrote:
>
>
> On 05/06/2015 17:08, Peter Maydell wrote:
>>> > Can someone add a checkpatch rule that forbids shifting left U or UL
>>> > constants (i.e. only ULL)? That would alleviate my concerns with these
>>> > ubsan warnings.
>>
>> ...but things like "(1U << 31)" are entirely valid.
>
> They're only valid until someone does a ~ on them. I think it's
> reasonable to forbid them in our coding standards, if we want to fix
> ubsan's warning of (1 << 31).
>
> I don't think it's reasonable for compiler writers to exploit the
> undefinedness of (1 << 31) anyway, and if it were possible to shut up
> ubsan about this particular kind of undefined behavior, I would prefer it.
I don't think it's reasonable for compiler writers to exploit
undefined behaviour either, but historically they absolutely
have done. Absent a guarantee from gcc that it will never do
so, I think we should avoid any UB in our code.
There's also the usual rationale that it's worth fixing the
borderline things that provoke complaints from lint-like tools
in order that new warnings don't get lost in the pile of old
uninteresting warnings.
thanks
-- PMM
- [Qemu-devel] [PULL 26/40] spapr_events: re-use EPOW event infrastructure for hotplug events, (continued)
- [Qemu-devel] [PULL 26/40] spapr_events: re-use EPOW event infrastructure for hotplug events, Alexander Graf, 2015/06/03
- [Qemu-devel] [PULL 32/40] spapr_pci: enable basic hotplug operations, Alexander Graf, 2015/06/03
- [Qemu-devel] [PULL 20/40] spapr_drc: initial implementation of sPAPRDRConnector device, Alexander Graf, 2015/06/03
- Re: [Qemu-devel] [PULL 00/40] ppc patch queue 2015-06-03, Peter Maydell, 2015/06/04
- Re: [Qemu-devel] [PULL 00/40] ppc patch queue 2015-06-03, Peter Maydell, 2015/06/05
- Re: [Qemu-devel] [PULL 00/40] ppc patch queue 2015-06-03, Paolo Bonzini, 2015/06/05
- Re: [Qemu-devel] [PULL 00/40] ppc patch queue 2015-06-03, Peter Maydell, 2015/06/05
- Re: [Qemu-devel] [PULL 00/40] ppc patch queue 2015-06-03, Paolo Bonzini, 2015/06/05
- Re: [Qemu-devel] [PULL 00/40] ppc patch queue 2015-06-03, Peter Maydell, 2015/06/05
- Re: [Qemu-devel] [PULL 00/40] ppc patch queue 2015-06-03, Paolo Bonzini, 2015/06/05
- Re: [Qemu-devel] [PULL 00/40] ppc patch queue 2015-06-03,
Peter Maydell <=
- [Qemu-devel] undefined behavior of signed left shifts (was Re: [PULL 00/40] ppc patch queue 2015-06-03), Paolo Bonzini, 2015/06/05
- Re: [Qemu-devel] undefined behavior of signed left shifts (was Re: [PULL 00/40] ppc patch queue 2015-06-03), Peter Maydell, 2015/06/05
- Re: [Qemu-devel] undefined behavior of signed left shifts (was Re: [PULL 00/40] ppc patch queue 2015-06-03), Joseph Myers, 2015/06/05
Re: [Qemu-devel] [PULL 00/40] ppc patch queue 2015-06-03, Eric Blake, 2015/06/05