From 021205d0219a5aa55e76fd19888b9c21ff3f4f3b Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Tue, 4 Oct 2022 09:40:55 +0200 Subject: [PATCH] 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. --- 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; -- 2.30.2