public inbox for binutils-cvs@sourceware.org
 help / color / mirror / Atom feed
* [binutils-gdb] RISC-V: don't cast expressions' X_add_number to long in diagnostics
@ 2022-10-04  7:41 Jan Beulich
  0 siblings, 0 replies; only message in thread
From: Jan Beulich @ 2022-10-04  7:41 UTC (permalink / raw)
  To: bfd-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=021205d0219a5aa55e76fd19888b9c21ff3f4f3b

commit 021205d0219a5aa55e76fd19888b9c21ff3f4f3b
Author: Jan Beulich <jbeulich@suse.com>
Date:   Tue Oct 4 09:40:55 2022 +0200

    RISC-V: don't cast expressions' X_add_number to long in diagnostics
    
    There's no need for such workarounds anymore now that we use C99
    uniformly. This addresses several testsuite failures encountered when
    (cross-)building on a 32-bit host.

Diff:
---
 gas/config/tc-riscv.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/gas/config/tc-riscv.c b/gas/config/tc-riscv.c
index f64b446bf11..98a954a2df0 100644
--- a/gas/config/tc-riscv.c
+++ b/gas/config/tc-riscv.c
@@ -3338,14 +3338,14 @@ riscv_ip (char *str, struct riscv_cl_insn *ip, expressionS *imm_expr,
 		      if (!sign)
 			{
 			  if (!VALIDATE_U_IMM (imm_expr->X_add_number, n))
-			    as_bad (_("improper immediate value (%lu)"),
-				    (unsigned long) imm_expr->X_add_number);
+			    as_bad (_("improper immediate value (%"PRIu64")"),
+				    imm_expr->X_add_number);
 			}
 		      else
 			{
 			  if (!VALIDATE_S_IMM (imm_expr->X_add_number, n))
-			    as_bad (_("improper immediate value (%li)"),
-				    (long) imm_expr->X_add_number);
+			    as_bad (_("improper immediate value (%"PRIi64")"),
+				    imm_expr->X_add_number);
 			}
 		      INSERT_IMM (n, s, *ip, imm_expr->X_add_number);
 		      imm_expr->X_op = O_absent;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-10-04  7:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-04  7:41 [binutils-gdb] RISC-V: don't cast expressions' X_add_number to long in diagnostics Jan Beulich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).