From patchwork Fri Sep 30 10:39:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Christoph_M=C3=BCllner?= X-Patchwork-Id: 1586 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp416286wrs; Fri, 30 Sep 2022 03:39:35 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5AcYTLR1oKzM9xp63QJzzl9ZqSVGE7WYiMjf1KRyeo2uzXv9xlusCABCrttkHpekBkgUdH X-Received: by 2002:a17:907:6d93:b0:783:d5a8:73ba with SMTP id sb19-20020a1709076d9300b00783d5a873bamr6174434ejc.185.1664534375121; Fri, 30 Sep 2022 03:39:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664534375; cv=none; d=google.com; s=arc-20160816; b=g7dMubnUl+PA7N6ynPmdstDY7nPquTT1XAzl8SoO2Jcay8jQrdtpYp1YLOIr3JDfI7 /WZGZOyStJzt+zdugHQU2d9zmNJgfTCoBwgpS0ROD5YRwlU6dkeidBhBNYk2K1vKL0DD hSZFCxvL7XyfkJclsKZdlmbIfci9iAfNbnTrOk/DVyIG85Rh0VZ63/uZ40LwAckN80J1 G62Z+51UvFS/J6+6J1suJKLB4tSHQMHLfFl9Bv3xgjOm3zT/xA2sU8oFnWNvsaLViUsu Po4a3jZqIRtOpPAKRt6BXGk/onSHlFwEoIp+TNwTN4mMMg8MukbMWXsaOiUZrvhMaj7t APWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:to:from:dkim-signature :dmarc-filter:delivered-to; bh=nVKAWrQy5AlSTUyYyUySacB4tqKrOeNdqwGhZTdxlJA=; b=Nvy54d2cPOPsOzwzcbLJHLzk6VHxsMlcyO0fXD2GAfD5hE8UGOFhWZWLe/QKBAsjiN p9wk4dih9hyZBM2D/UExGWSp7oElr9j8v1ZKnPjdscJQKxEwIWFVCWDXJ+PM0F2dpFSi tw0kKPDl9GDWxPTlnS9dVzP8i+uVsiWeHnuD/1zRNzBLLGjvlj4kvExvsCGkbpTxqLkL VuiEzqgcOAmEvb/kHeuxEKxmb+pSoYliPSEK9DxgkMiK2QO9aEtmQp6oDfk7kM1fJhSK eEE8d8CbG/b5PSaf51pW8ka4NYG5qy4g6YJFK0FZnI+l5PhxZa6AwUa1OA2719u5RLoO AzOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@vrull.eu header.s=google header.b=dzGl0n65; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org" Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id b23-20020aa7cd17000000b00457f4278879si1670692edw.574.2022.09.30.03.39.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Sep 2022 03:39:35 -0700 (PDT) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=fail header.i=@vrull.eu header.s=google header.b=dzGl0n65; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5C82C385842E for ; Fri, 30 Sep 2022 10:39:33 +0000 (GMT) X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org 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-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 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 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 X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org Sender: "Binutils" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1745390796917147180?= X-GMAIL-MSGID: =?utf-8?q?1745390796917147180?= 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;