From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id WWW3F1Cx5GovAhYAWB0awg (envelope-from ) for ; Fri, 30 Oct 2026 11:01:36 -0400 Received: by simark.ca (Postfix, from userid 112) id 53CF5378002; Fri, 30 Oct 2026 11:01:36 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-5.3 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [IPv6:2620:52:6:3111::32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 3CD5B1E023 for ; Fri, 30 Oct 2026 11:01:35 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DBED94BAE7E7 for ; Fri, 30 Oct 2026 15:01:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DBED94BAE7E7 Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 079534BAE7C3 for ; Fri, 30 Oct 2026 15:01:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 079534BAE7C3 Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=efficios.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=efficios.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 079534BAE7C3 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=158.69.221.121 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1793372470; cv=none; b=awnRkt5fqa479OJLecu8G7yqkz6pxNPyC+gdtlICRHhvzAfyj+QgXllpLz48+hdSIKiQMJjJ32mpOCYb5jDz4OJQQijz97Kg2TuN041YgALVAMSwOadN59/fb+hy1KPCsXTsv9RWtowvR/vFWZcKELg7Nz3enxfWig7sFwBOCLQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1793372470; c=relaxed/simple; bh=B+TKHcrGhDaCuey1UyVHpb6tmysnaNQu9ZwNksPfwKc=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=qp9+in/XZTcUJlpT8FwspaMbubwfD+1klBlShTY2qlPrl3W0CWdfszGzUPFD0Ow/sr0ZhFt9T+p4Z1w9/5qrsRwINPEP27ezmrahp0uvbf0SvgVfAIROb/ld7OEOx6HkNCuhoGwkv46KBLZqAp6mQ26jCFbpk1OpWoU7KXEkYbk= ARC-Authentication-Results: i=1; sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 079534BAE7C3 Received: by simark.ca (Postfix) id DC49F1E023; Fri, 30 Oct 2026 11:01:08 -0400 (EDT) From: Simon Marchi To: gdb-patches@sourceware.org Cc: Simon Marchi , Andrew Burgess , Mike Frysinger Subject: [PATCH] sim/erc32: fix -Wunused-but-set-global errors Date: Fri, 30 Oct 2026 11:01:03 -0400 Message-ID: <20261030150107.1146587-1-simon.marchi@efficios.com> X-Mailer: git-send-email 2.56.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org Building the erc32 simulator with a recent clang fails with: /home/smarchi/src/binutils-gdb/sim/erc32/erc32.c:159:19: error: variable 'mec_icr' set but not used [-Werror,-Wunused-but-set-global] /home/smarchi/src/binutils-gdb/sim/erc32/erc32.c:165:19: error: variable 'posted_irq' set but not used [-Werror,-Wunused-but-set-global] /home/smarchi/src/binutils-gdb/sim/erc32/erc32.c:247:19: error: variable 'uarta_data' set but not used [-Werror,-Wunused-but-set-global] mec_icr and posted_irq are only ever set to 0 in mec_reset. Remove them. uarta_data and uartb_data are only read when FAST_UART is not defined, but the simulator is build with FAST_UART by default. Mark them ATTRIBUTE_UNUSED, like functions uart_rx, uarta_tx and uartb_tx, which are in the same situation. Cc: Andrew Burgess Cc: Mike Frysinger Change-Id: I56d04a1141f05a9e1a66984a68c390a36ad9b0a1 --- sim/erc32/erc32.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/sim/erc32/erc32.c b/sim/erc32/erc32.c index 4e9b645d1f3a..f3d9b49b9807 100644 --- a/sim/erc32/erc32.c +++ b/sim/erc32/erc32.c @@ -156,13 +156,11 @@ static uint32_t mec_ffar; static uint32_t mec_ipr; static uint32_t mec_imr; static uint32_t mec_isr; -static uint32_t mec_icr; static uint32_t mec_ifr; static uint32_t mec_mcr; /* MEC control register */ static uint32_t mec_memcfg; /* Memory control register */ static uint32_t mec_wcr; /* MEC waitstate register */ static uint32_t mec_iocr; /* MEC IO control register */ -static uint32_t posted_irq; static uint32_t mec_ersr; /* MEC error and status register */ static uint32_t mec_tcr; /* MEC test comtrol register */ @@ -244,7 +242,7 @@ static int f1open = 0, f2open = 0; static char uarta_sreg, uarta_hreg, uartb_sreg, uartb_hreg; static uint32_t uart_stat_reg; -static uint32_t uarta_data, uartb_data; +ATTRIBUTE_UNUSED static uint32_t uarta_data, uartb_data; #ifdef ERA int era = 0; @@ -504,7 +502,6 @@ mec_reset(void) mec_ipr = 0; mec_imr = 0x7ffe; mec_isr = 0; - mec_icr = 0; mec_ifr = 0; mec_memcfg = 0x10000; mec_wcr = -1; @@ -515,7 +512,6 @@ mec_reset(void) decode_wcr(); decode_mcr(); - posted_irq = 0; wnuma = wnumb = 0; anum = aind = bnum = bind = 0; base-commit: bb0a4659ab1eb997ad095181ef309f7b7d9aa289 -- 2.56.0