From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id AZ2+F2omg2q1LC0AWB0awg (envelope-from ) for ; Mon, 17 Aug 2026 11:19:06 -0400 Received: by simark.ca (Postfix, from userid 112) id 5EBA21E167; Mon, 17 Aug 2026 11:19:06 -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 0B1401E033 for ; Mon, 17 Aug 2026 11:19:06 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5F28B4BA9036 for ; Mon, 17 Aug 2026 15:19:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5F28B4BA9036 Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 903434BA23FA; Mon, 17 Aug 2026 15:16:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 903434BA23FA 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 903434BA23FA 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=1786979814; cv=none; b=VwvHyr91N/mHSW5dXwA950wOsf7TO3D+2rOAwv12Rfi6Y4j7A/hoT0n5+AHeeAprRVDNlcVi0u3D8yOG0jvgs/0XP8Ql1u+r9SHHP3uz/T/G+pVEOmOG6r++wzEj5oPdv+4PMvdZTm4zfnVCrE88Q8ApZoOn0r1B2zDWNa8IjLI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1786979814; c=relaxed/simple; bh=h19DNntdaibVpZ1+Mt4nUhPUi1OLfq6PmDpffA/RO7Q=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=BeT056Ok9INRWarlIPsFrtrhp9dWYQDMKN3uac754nA+HpaSXNziKDGftehrwPG/GaqETy1zNhUr9Yd4RKHOwjTY1XMO1WvlYMEiHlkv6T86LxtwieRPIf1F2hRjdnp0RyBamBHTl0C7Jwh42palTZYqIuTKI71FP1T+OXaSAnk= ARC-Authentication-Results: i=1; sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 903434BA23FA Received: by simark.ca (Postfix) id AE84F1E171; Mon, 17 Aug 2026 11:16:52 -0400 (EDT) From: Simon Marchi To: gdb-patches@sourceware.org, binutils@sourceware.org Cc: Simon Marchi Subject: [PATCH 06/13] sim/m32r: fix unused function warnings on non-Linux hosts Date: Mon, 17 Aug 2026 11:16:11 -0400 Message-ID: <20260817151646.152571-7-simon.marchi@efficios.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260817151646.152571-1-simon.marchi@efficios.com> References: <20260817151646.152571-1-simon.marchi@efficios.com> 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 When building on macOS, I get: /Users/smarchi/src/binutils-gdb/sim/m32r/traps.c:141:1: error: unused function 't2h_addr' [-Werror,-Wunused-function] 141 | t2h_addr (host_callback *cb, struct cb_syscall *sc, | ^~~~~~~~ /Users/smarchi/src/binutils-gdb/sim/m32r/traps.c:158:1: error: unused function 'translate_endian_h2t' [-Werror,-Wunused-function] 158 | translate_endian_h2t (void *addr, size_t size) | ^~~~~~~~~~~~~~~~~~~~ /Users/smarchi/src/binutils-gdb/sim/m32r/traps.c:171:1: error: unused function 'translate_endian_t2h' [-Werror,-Wunused-function] 171 | translate_endian_t2h (void *addr, size_t size) | ^~~~~~~~~~~~~~~~~~~~ These three helpers are only called from the TRAP_LINUX_SYSCALL case, which is guarded by `#ifdef __linux__'. Put them behind the same guard. Change-Id: I8c8744727eb27abc08231be2a10f8d0de44d7ea6 --- sim/m32r/traps.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sim/m32r/traps.c b/sim/m32r/traps.c index bb82ae80e2aa..43a81c915d1c 100644 --- a/sim/m32r/traps.c +++ b/sim/m32r/traps.c @@ -134,7 +134,9 @@ m32r_core_signal (SIM_DESC sd, SIM_CPU *current_cpu, sim_cia cia, sim_core_signal (sd, current_cpu, cia, map, nr_bytes, addr, transfer, sig); } - + +#ifdef __linux__ + /* Translate target's address to host's address. */ static void * @@ -180,6 +182,8 @@ translate_endian_t2h (void *addr, size_t size) *((unsigned short *) p) = T2H_2 (*((unsigned short *) p)); } +#endif /* __linux__ */ + /* Trap support. The result is the pc address to continue at. Preprocessing like saving the various registers has already been done. */ -- 2.55.0