From 4919138bb21768d0cdc3a6da81dbbbd62cc96855 Mon Sep 17 00:00:00 2001 From: Tsukasa OI Date: Wed, 13 Jul 2022 22:33:07 +0900 Subject: [PATCH] RISC-V: fix printf types on riscv-dis.c %x requires `unsigned' type, not `int'. This commit fixes that. opcodes/ChangeLog: * riscv-dis.c (print_insn_args): Fix printf types from `int' to `unsigned'. --- opcodes/riscv-dis.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/opcodes/riscv-dis.c b/opcodes/riscv-dis.c index 164fd209dbd..c031ce9ae8f 100644 --- a/opcodes/riscv-dis.c +++ b/opcodes/riscv-dis.c @@ -283,15 +283,15 @@ print_insn_args (const char *oparg, insn_t l, bfd_vma pc, disassemble_info *info break; case 'u': print (info->stream, dis_style_immediate, "0x%x", - (int)(EXTRACT_CITYPE_IMM (l) & (RISCV_BIGIMM_REACH-1))); + (unsigned)(EXTRACT_CITYPE_IMM (l) & (RISCV_BIGIMM_REACH-1))); break; case '>': print (info->stream, dis_style_immediate, "0x%x", - (int)EXTRACT_CITYPE_IMM (l) & 0x3f); + (unsigned)EXTRACT_CITYPE_IMM (l) & 0x3f); break; case '<': print (info->stream, dis_style_immediate, "0x%x", - (int)EXTRACT_CITYPE_IMM (l) & 0x1f); + (unsigned)EXTRACT_CITYPE_IMM (l) & 0x1f); break; case 'T': /* Floating-point RS2. */ print (info->stream, dis_style_register, "%s", @@ -473,7 +473,7 @@ print_insn_args (const char *oparg, insn_t l, bfd_vma pc, disassemble_info *info case 'y': print (info->stream, dis_style_text, "0x%x", - (int)EXTRACT_OPERAND (BS, l)); + (unsigned)EXTRACT_OPERAND (BS, l)); break; case 'z': @@ -482,12 +482,12 @@ print_insn_args (const char *oparg, insn_t l, bfd_vma pc, disassemble_info *info case '>': print (info->stream, dis_style_immediate, "0x%x", - (int)EXTRACT_OPERAND (SHAMT, l)); + (unsigned)EXTRACT_OPERAND (SHAMT, l)); break; case '<': print (info->stream, dis_style_immediate, "0x%x", - (int)EXTRACT_OPERAND (SHAMTW, l)); + (unsigned)EXTRACT_OPERAND (SHAMTW, l)); break; case 'S': @@ -547,7 +547,7 @@ print_insn_args (const char *oparg, insn_t l, bfd_vma pc, disassemble_info *info case 'Y': print (info->stream, dis_style_text, "0x%x", - (int) EXTRACT_OPERAND (RNUM, l)); + (unsigned) EXTRACT_OPERAND (RNUM, l)); break; case 'Z':