[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-trivial] [PATCH v2 00/12] Avoid shifting left into sign bit

From: Michael Tokarev
Subject: Re: [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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]