From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x634.google.com (mail-ej1-x634.google.com [IPv6:2a00:1450:4864:20::634]) by sourceware.org (Postfix) with ESMTPS id DB83A3858CDB for ; Fri, 30 Sep 2022 10:39:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org DB83A3858CDB Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=vrull.eu Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=vrull.eu Received: by mail-ej1-x634.google.com with SMTP id lh5so8134045ejb.10 for ; Fri, 30 Sep 2022 03:39:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vrull.eu; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date; bh=nVKAWrQy5AlSTUyYyUySacB4tqKrOeNdqwGhZTdxlJA=; b=dzGl0n65iYdxH3q3WD4Lt94sfLBm6jBXsc37pUgZnWxB/c7+JMqsuiDvwC6K8mZaa2 VOkwIyrKzvqVIroKwQzzixYMlQYipULQd0saDH6KcPHFjSoqTYfaM5KxsYdiM6Tmiqok fpTBJeaPIJGWmhEUXDOuYWmIrKsbIezPfQ29fRf90T+lBNJaeVlrrYzBg/5O38Xwkc2P +B2qUnRyPPzCIlzCG/1251mejsVb30iaaFYvmMjQQjh5tX/69TgbVGkJUnMV8g7+wWa/ VFtRpi98wjjR1pAlxTzW316mdL4Nn1E9CZB6pbx4G/qaiw4kF5E+LVQWOJ7uTOI7Joht AYnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date; bh=nVKAWrQy5AlSTUyYyUySacB4tqKrOeNdqwGhZTdxlJA=; b=uusLlDjETRT5+4N8pyxvbrrvvM3uRAeihlgPjYBYgPMjD53OwcOBV9leg9vh5DgjV8 eP/e6cvyUz+KDe2fvbB6xyDndJY16EavFVXVkWAH7I1aFSrf+X19CeZibX2oHSAaWX6a zso+RavOJihajm0O3gDAllTqrczJajmyTAE3zFuRhugNcjFJJE8tUp9dBAxTcUWTxrjK Zv4NyClnWxUMT+4NPUqRaU1omG7G+pcpUW7PmX2yJHAtHouNNsggCnweoTqUDorRJX5N /ShO6LK2jTQRAy8smbK1W7TKZ+ePNeafEXnpgHwuv8QAwZ+CaSsi8UpMPNXHrWDKFnr1 w5Ew== X-Gm-Message-State: ACrzQf3m7Dm7OXe0orgf/QvAS1A6D4gSKXvGJQdhLm+do/eLKawf+lVT 28ixY50qu6M8qvmIx3O0hrL3saReQHSFPA== X-Google-Smtp-Source: AMsMyM5Riu/npyhtJp/j+9/fImRbonKxEdT/3oydl/hEmgG9uGrf0M3zerhG+7ZRhWjjcK0fJ7gSTw== X-Received: by 2002:a17:907:961e:b0:782:670d:9ff9 with SMTP id gb30-20020a170907961e00b00782670d9ff9mr6175392ejc.387.1664534363589; Fri, 30 Sep 2022 03:39:23 -0700 (PDT) Received: from beast.fritz.box (62-178-148-172.cable.dynamic.surfer.at. [62.178.148.172]) by smtp.gmail.com with ESMTPSA id 7-20020a170906310700b00740f1a58e0bsm1004311ejx.30.2022.09.30.03.39.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Sep 2022 03:39:23 -0700 (PDT) From: Christoph Muellner To: binutils@sourceware.org, Nelson Chu , Andrew Waterman , Palmer Dabbelt , Jim Wilson , Philipp Tomsich , Jan Beulich Cc: =?UTF-8?q?Christoph=20M=C3=BCllner?= Subject: [PATCH] RISC-V: Eliminate long-casts of X_add_number in diagnostics Date: Fri, 30 Sep 2022 12:39:19 +0200 Message-Id: <20220930103919.323690-1-christoph.muellner@vrull.eu> X-Mailer: git-send-email 2.37.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,JMQ_SPF_NEUTRAL,KAM_MANYTO,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: From: Christoph Müllner As reported in (and in addition to) https://sourceware.org/pipermail/binutils/2022-September/123198.html there is no need for casts to (signed/unsigned) long, as we can use C99's PRIs64/PRIu64 format specifiers. Signed-off-by: Christoph Müllner --- gas/config/tc-riscv.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/gas/config/tc-riscv.c b/gas/config/tc-riscv.c index b107420756b..035d8c55628 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; -- 2.37.2