From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40391) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZwBIr-0004CG-Px for qemu-devel@nongnu.org; Tue, 10 Nov 2015 10:57:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZwBIn-0003Zu-AI for qemu-devel@nongnu.org; Tue, 10 Nov 2015 10:57:49 -0500 Received: from mx1.redhat.com ([209.132.183.28]:45639) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZwBIm-0003Zg-T8 for qemu-devel@nongnu.org; Tue, 10 Nov 2015 10:57:45 -0500 From: Stefan Hajnoczi Date: Tue, 10 Nov 2015 15:57:35 +0000 Message-Id: <1447171055-29567-4-git-send-email-stefanha@redhat.com> In-Reply-To: <1447171055-29567-1-git-send-email-stefanha@redhat.com> References: <1447171055-29567-1-git-send-email-stefanha@redhat.com> Subject: [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: qemu-devel@nongnu.org Cc: Peter Maydell , ehabkost@redhat.com, Stefan Hajnoczi 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 --- disas/arm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/disas/arm.c b/disas/arm.c index 6165246..7a7354b 100644 --- a/disas/arm.c +++ b/disas/arm.c @@ -1779,7 +1779,7 @@ print_insn_coprocessor (bfd_vma pc, struct disassemble_info *info, long given, /* Is ``imm'' a negative number? */ if (imm & 0x40) - imm |= (-1 << 7); + imm |= (~0u << 7); func (stream, "%d", imm); } -- 2.5.0