Skip to content

Commit

Permalink
disas/arm: avoid clang shifting negative signed warning
Browse files Browse the repository at this point in the history
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 <stefanha@redhat.com>
  • Loading branch information
stefanhaRH committed Nov 17, 2015
1 parent 886ce6f commit 02460c3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion disas/arm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 02460c3

Please sign in to comment.