From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34117) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZykwS-00089a-IN for qemu-devel@nongnu.org; Tue, 17 Nov 2015 13:25:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZykwR-0001Vc-SJ for qemu-devel@nongnu.org; Tue, 17 Nov 2015 13:25:20 -0500 Received: from mail-yk0-x22d.google.com ([2607:f8b0:4002:c07::22d]:36064) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZykwR-0001VY-OH for qemu-devel@nongnu.org; Tue, 17 Nov 2015 13:25:19 -0500 Received: by ykdr82 with SMTP id r82so20842816ykd.3 for ; Tue, 17 Nov 2015 10:25:19 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <564B702E.4070806@redhat.com> References: <1447769349-1767-1-git-send-email-pbonzini@redhat.com> <874mgkh6f5.fsf@blackfin.pond.sub.org> <564B67BE.5040001@redhat.com> <564B702E.4070806@redhat.com> From: Peter Maydell Date: Tue, 17 Nov 2015 18:24:58 +0000 Message-ID: Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] [PATCH v2 for 2.5] QEMU does not care about left shifts of signed negative values List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Laszlo Ersek , Markus Armbruster , QEMU Developers On 17 November 2015 at 18:21, Paolo Bonzini wrote: > > > On 17/11/2015 19:19, Peter Maydell wrote: >> That doesn't seem like more than half-good news to me. In particular, >> if ubsan is still diagnosing these cases and they're still a >> problem in some constant expressions > > Constant expressions are standardese for e.g. > > static int x = 1 << 31; > > It doesn't mean _all_ constants, and the warning only triggers with > -pedantic. But if "-fwrapv" means "this dialect of C makes shifts of negative numbers well defined and OK" then "-1 << 31" should be fine and should not provoke a warning (whether in a constant expression or not). If that's not what -fwrapv means, then we shouldn't be using it as if it did. thanks -- PMM