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 <stefa...@redhat.com>
---
 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


Reply via email to