[PATCH] RISC-V: don't cast expressions' X_add_number to long in diagnostics
Christoph Müllner
christoph.muellner@vrull.eu
Fri Sep 30 10:13:13 GMT 2022
Hi Jan,
Thanks for pointing that out!
I admit, that I was just following the established pattern in this file.
There are four more identical cases in this file ("improper "... outputs).
I'll take care of them (unless you pick them up as well).
Tested-by: Christoph Müllner <christoph.muellner@vrull.eu>
Thanks,
Christoph
On Fri, Sep 30, 2022 at 11:42 AM Jan Beulich <jbeulich@suse.com> wrote:
> 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.
>
> --- a/gas/config/tc-riscv.c
> +++ b/gas/config/tc-riscv.c
> @@ -3338,14 +3338,14 @@ riscv_ip (char *str, struct riscv_cl_ins
> 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;
>
More information about the Binutils
mailing list