From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-sender-0.a4lg.com (mail-sender.a4lg.com [153.120.152.154]) by sourceware.org (Postfix) with ESMTPS id 0F0F7385AC2C for ; Mon, 3 Oct 2022 10:44:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0F0F7385AC2C Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=irq.a4lg.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=irq.a4lg.com Received: from [127.0.0.1] (localhost [127.0.0.1]) by mail-sender-0.a4lg.com (Postfix) with ESMTPSA id 5DAF1300089; Mon, 3 Oct 2022 10:44:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=irq.a4lg.com; s=2017s01; t=1664793891; bh=iyrbhmgYlTidHDPmRgPXWpz3k77eUUr5gQG9DxCES8w=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Mime-Version:Content-Transfer-Encoding; b=TExSvOWxaJkHWhTPp1xrv+Z+jrZvrZgh7YhLWDJ2RQKGqKTGuDEQ4XYQDIH0xlYy2 tR4LDbLzQQ5RaU119bN048rHhRs6vRHM/Cb8Mq8ekQlX/iyqxCF7VI0IdNvUkpmM5T hTq/UsIp0MsjlPlTt+ov6mVmMyKoI1GU/cz2SLRs= From: Tsukasa OI To: Tsukasa OI , =?UTF-8?q?Christoph=20M=C3=BCllner?= , Nelson Chu , Kito Cheng , Palmer Dabbelt , Andrew Burgess Cc: binutils@sourceware.org Subject: [PATCH v3 2/6] RISC-V: Fix printf argument types corresponding %x Date: Mon, 3 Oct 2022 10:44:00 +0000 Message-Id: In-Reply-To: References: Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,GIT_PATCH_0,KAM_MANYTO,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: "%x" format specifier requires unsigned type, not int. This commit fixes this issue on the RISC-V disassembler. opcodes/ChangeLog: * riscv-dis.c (print_insn_args): Fix printf argument types where the format specifier is "%x". --- 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 a5bfa97058a..503b839f19e 100644 --- a/opcodes/riscv-dis.c +++ b/opcodes/riscv-dis.c @@ -292,15 +292,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", @@ -481,7 +481,7 @@ print_insn_args (const char *oparg, insn_t l, bfd_vma pc, disassemble_info *info case 'y': print (info->stream, dis_style_immediate, "0x%x", - (int)EXTRACT_OPERAND (BS, l)); + (unsigned)EXTRACT_OPERAND (BS, l)); break; case 'z': @@ -490,12 +490,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': @@ -555,7 +555,7 @@ print_insn_args (const char *oparg, insn_t l, bfd_vma pc, disassemble_info *info case 'Y': print (info->stream, dis_style_immediate, "0x%x", - (int) EXTRACT_OPERAND (RNUM, l)); + (unsigned) EXTRACT_OPERAND (RNUM, l)); break; case 'Z': -- 2.34.1