diff options
author | Christoph Müllner <christoph.muellner@vrull.eu> | 2022-09-30 12:15:14 +0200 |
---|---|---|
committer | Philipp Tomsich <philipp.tomsich@vrull.eu> | 2022-09-30 16:54:33 +0200 |
commit | a6eeb20a42a854f9127dcf1a0b54ed8c4f50f27c (patch) | |
tree | 75011a5d9e840d1775a730fb1d685e9209bfdf8e | |
parent | 0b8c36f7177afa59cb1527c62c3d04030c9a092d (diff) | |
download | gdb-a6eeb20a42a854f9127dcf1a0b54ed8c4f50f27c.zip gdb-a6eeb20a42a854f9127dcf1a0b54ed8c4f50f27c.tar.gz gdb-a6eeb20a42a854f9127dcf1a0b54ed8c4f50f27c.tar.bz2 |
RISC-V: Eliminate long-casts of X_add_number in diagnostics
There is no need for casts to (signed/unsigned) long, as we can use
C99's PRId64/PRIu64 format specifiers.
-rw-r--r-- | gas/config/tc-riscv.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/gas/config/tc-riscv.c b/gas/config/tc-riscv.c index 38ff016..bd8f65d 100644 --- a/gas/config/tc-riscv.c +++ b/gas/config/tc-riscv.c @@ -2921,8 +2921,8 @@ riscv_ip (char *str, struct riscv_cl_insn *ip, expressionS *imm_expr, my_getExpression (imm_expr, asarg); check_absolute_expr (ip, imm_expr, false); if ((unsigned long) imm_expr->X_add_number > 31) - as_bad (_("improper shift amount (%lu)"), - (unsigned long) imm_expr->X_add_number); + as_bad (_("improper shift amount (%"PRIu64")"), + imm_expr->X_add_number); INSERT_OPERAND (SHAMTW, *ip, imm_expr->X_add_number); imm_expr->X_op = O_absent; asarg = expr_end; @@ -2932,8 +2932,8 @@ riscv_ip (char *str, struct riscv_cl_insn *ip, expressionS *imm_expr, my_getExpression (imm_expr, asarg); check_absolute_expr (ip, imm_expr, false); if ((unsigned long) imm_expr->X_add_number >= xlen) - as_bad (_("improper shift amount (%lu)"), - (unsigned long) imm_expr->X_add_number); + as_bad (_("improper shift amount (%"PRIu64")"), + imm_expr->X_add_number); INSERT_OPERAND (SHAMT, *ip, imm_expr->X_add_number); imm_expr->X_op = O_absent; asarg = expr_end; @@ -2943,8 +2943,8 @@ riscv_ip (char *str, struct riscv_cl_insn *ip, expressionS *imm_expr, my_getExpression (imm_expr, asarg); check_absolute_expr (ip, imm_expr, false); if ((unsigned long) imm_expr->X_add_number > 31) - as_bad (_("improper CSRxI immediate (%lu)"), - (unsigned long) imm_expr->X_add_number); + as_bad (_("improper CSRxI immediate (%"PRIu64")"), + imm_expr->X_add_number); INSERT_OPERAND (RS1, *ip, imm_expr->X_add_number); imm_expr->X_op = O_absent; asarg = expr_end; @@ -2960,8 +2960,8 @@ riscv_ip (char *str, struct riscv_cl_insn *ip, expressionS *imm_expr, my_getExpression (imm_expr, asarg); check_absolute_expr (ip, imm_expr, true); if ((unsigned long) imm_expr->X_add_number > 0xfff) - as_bad (_("improper CSR address (%lu)"), - (unsigned long) imm_expr->X_add_number); + as_bad (_("improper CSR address (%"PRIu64")"), + imm_expr->X_add_number); INSERT_OPERAND (CSR, *ip, imm_expr->X_add_number); imm_expr->X_op = O_absent; asarg = expr_end; |