[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL for-2.5 4/7] disas/arm: avoid clang shifting negative
From: |
Stefan Hajnoczi |
Subject: |
[Qemu-devel] [PULL for-2.5 4/7] disas/arm: avoid clang shifting negative signed warning |
Date: |
Tue, 17 Nov 2015 19:17:25 +0800 |
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 <address@hidden>
---
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
- [Qemu-devel] [PULL for-2.5 0/7] Block patches, Stefan Hajnoczi, 2015/11/17
- [Qemu-devel] [PULL for-2.5 1/7] docs: update bitmaps.md, Stefan Hajnoczi, 2015/11/17
- [Qemu-devel] [PULL for-2.5 2/7] tests: Ignore recent test binaries, Stefan Hajnoczi, 2015/11/17
- [Qemu-devel] [PULL for-2.5 3/7] tpm: avoid clang shifting negative signed warning, Stefan Hajnoczi, 2015/11/17
- [Qemu-devel] [PULL for-2.5 4/7] disas/arm: avoid clang shifting negative signed warning,
Stefan Hajnoczi <=
- [Qemu-devel] [PULL for-2.5 5/7] aio-epoll: Fix use-after-free of node, Stefan Hajnoczi, 2015/11/17
- [Qemu-devel] [PULL for-2.5 6/7] block: make 'stats-interval' an array of ints instead of a string, Stefan Hajnoczi, 2015/11/17
- [Qemu-devel] [PULL for-2.5 7/7] virtio-blk: Fix double completion for werror=stop, Stefan Hajnoczi, 2015/11/17
- Re: [Qemu-devel] [PULL for-2.5 0/7] Block patches, Peter Maydell, 2015/11/17