[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [Qemu-trivial] [PATCH v2 00/12] Avoid shifting left int
From: |
Michael Tokarev |
Subject: |
Re: [Qemu-devel] [Qemu-trivial] [PATCH v2 00/12] Avoid shifting left into sign bit |
Date: |
Thu, 20 Mar 2014 20:04:35 +0400 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20131103 Icedove/17.0.10 |
17.03.2014 20:00, Peter Maydell wrote:
> This is a set of patches which silence clang -fsanitize=undefined
> warnings about shifting left into the sign bit of a signed value.
> Typically this is the result of "1 << 31" and similar constructs;
> the fix is to add a "U" suffix to the 1 so that we do unsigned
> arithmetic rather than signed arithmetic.
>
> Since these patches are very minor changes to a fairly
> wide ranging set of files, it seems easiest to send these
> through the -trivial queue. Happy to split the series up
> if people disagree.
>
> Mostly I think these warnings are not particularly exciting
> (even the adversarial optimizations preferred by modern
> compilers will probably not break "1 << 31") but there are
> a lot of them, the fix is pretty trivial, and getting rid of
> them allows us to see the interesting sanitizer warnings more
> clearly.
>
> My method here has been just to look at the warnings produced
> during a 'make check' run; no doubt actually running a guest
> for various platforms would identify more of these.
>
> Changes v1->v2:
> * minor tweak to foreach_apic to merge declaration
> and initialization of 'mask'
> * add U suffix to other constants in the same group
> for consistency, as suggested by mst
Thanks, applied to -trivial, after capitalizing "U" suffix
in 03/12.
/mjt
- [Qemu-devel] [PATCH v2 08/12] hw/ppc: Avoid shifting left into sign bit, (continued)
- [Qemu-devel] [PATCH v2 08/12] hw/ppc: Avoid shifting left into sign bit, Peter Maydell, 2014/03/17
- [Qemu-devel] [PATCH v2 03/12] hw/pci/pci_host.c: Avoid shifting left into sign bit, Peter Maydell, 2014/03/17
- [Qemu-devel] [PATCH v2 12/12] hw/pci-host/apb.c: Avoid shifting left into sign bit, Peter Maydell, 2014/03/17
- [Qemu-devel] [PATCH v2 02/12] hw/intc/apic.c: Use uint32_t for mask word in foreach_apic, Peter Maydell, 2014/03/17
- [Qemu-devel] [PATCH v2 09/12] tests/libqos/pci-pc: Avoid shifting left into sign bit, Peter Maydell, 2014/03/17
- [Qemu-devel] [PATCH v2 07/12] hw/intc/openpic: Avoid shifting left into sign bit, Peter Maydell, 2014/03/17
- [Qemu-devel] [PATCH v2 06/12] hw/usb/hcd-ohci.c: Avoid shifting left into sign bit, Peter Maydell, 2014/03/17
- [Qemu-devel] [PATCH v2 01/12] target-i386: Avoid shifting left into sign bit, Peter Maydell, 2014/03/17
- [Qemu-devel] [PATCH v2 05/12] target-mips: Avoid shifting left into sign bit, Peter Maydell, 2014/03/17
- [Qemu-devel] [PATCH v2 04/12] hw/i386/acpi_build.c: Avoid shifting left into sign bit, Peter Maydell, 2014/03/17
- Re: [Qemu-devel] [Qemu-trivial] [PATCH v2 00/12] Avoid shifting left into sign bit,
Michael Tokarev <=