Received: from eggs.gnu.org ([2001:4830:134:3::10]:37899) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WQfSX-0002EP-2c for qemu-devel@nongnu.org; Thu, 20 Mar 2014 12:04:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WQfSP-0007H1-3K for qemu-devel@nongnu.org; Thu, 20 Mar 2014 12:04:45 -0400 Message-ID: <532B1193.3040808@msgid.tls.msk.ru> Date: Thu, 20 Mar 2014 20:04:35 +0400 From: Michael Tokarev MIME-Version: 1.0 References: <1395072041-18911-1-git-send-email-peter.maydell@linaro.org> In-Reply-To: <1395072041-18911-1-git-send-email-peter.maydell@linaro.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [Qemu-trivial] [PATCH v2 00/12] Avoid shifting left into sign bit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: qemu-trivial@nongnu.org, qemu-ppc@nongnu.org, qemu-devel@nongnu.org, patches@linaro.org 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