RISC-V: don't cast expressions' X_add_number to long in diagnostics
authorJan Beulich <jbeulich@suse.com>
Tue, 4 Oct 2022 07:40:55 +0000 (09:40 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 4 Oct 2022 07:40:55 +0000 (09:40 +0200)
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

index f64b446bf1158c3deb848c8270f4c90b46f88dd2..98a954a2df08b9af1d6d133e7e95255cb57154c3 100644 (file)
@@ -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;