From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43525) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZwCnl-0001SF-5I for qemu-devel@nongnu.org; Tue, 10 Nov 2015 12:33:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZwCni-0005X0-09 for qemu-devel@nongnu.org; Tue, 10 Nov 2015 12:33:49 -0500 Received: from mail-wm0-x234.google.com ([2a00:1450:400c:c09::234]:32934) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZwCnh-0005W1-Pm for qemu-devel@nongnu.org; Tue, 10 Nov 2015 12:33:45 -0500 Received: by wmec201 with SMTP id c201so145274124wme.0 for ; Tue, 10 Nov 2015 09:33:45 -0800 (PST) Sender: Paolo Bonzini References: <1447171055-29567-1-git-send-email-stefanha@redhat.com> <1447171055-29567-4-git-send-email-stefanha@redhat.com> From: Paolo Bonzini Message-ID: <56422A70.8040306@redhat.com> Date: Tue, 10 Nov 2015 18:33:36 +0100 MIME-Version: 1.0 In-Reply-To: <1447171055-29567-4-git-send-email-stefanha@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 3/3] disas/arm: avoid clang shifting negative signed warning List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Peter Maydell , ehabkost@redhat.com On 10/11/2015 16:57, Stefan Hajnoczi wrote: > clang 3.7.0 on x86_64 warns about the following: > > disas/arm.c:1782:17: warning: shifting a negative signed value is undefined [-Wshift-negative-value] > imm |= (-1 << 7); > ~~ ^ > > Note that this patch preserves the tab indent in this source file > because the surrounding code still uses tabs. > > Signed-off-by: Stefan Hajnoczi I would like to know a case where (except with ubsan) clang actually uses the optimization. If not, this is just error message theatre (which is not news for clang) and shouldn't have been part of -Wall. Paolo