From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33248) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z0tQG-0001bU-Gq for qemu-devel@nongnu.org; Fri, 05 Jun 2015 11:20:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z0tQA-0002b7-KZ for qemu-devel@nongnu.org; Fri, 05 Jun 2015 11:20:40 -0400 Message-ID: <5571BE3D.9050002@redhat.com> Date: Fri, 05 Jun 2015 17:20:29 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1433367941-119488-1-git-send-email-agraf@suse.de> <5571B3BE.60003@redhat.com> <5571BA13.3040507@redhat.com> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PULL 00/40] ppc patch queue 2015-06-03 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Michael Roth , "qemu-ppc@nongnu.org" , Alexander Graf , QEMU Developers 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. Paolo