From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id JkmhI2sng2oFLi0AWB0awg (envelope-from ) for ; Mon, 17 Aug 2026 11:23:23 -0400 Received: by simark.ca (Postfix, from userid 112) id 7FCE51E0A3; Mon, 17 Aug 2026 11:23:23 -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 1218B1E033 for ; Mon, 17 Aug 2026 11:23:23 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 48F854BA9013 for ; Mon, 17 Aug 2026 15:23:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 48F854BA9013 Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id D40FB4BA7985; Mon, 17 Aug 2026 15:16:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D40FB4BA7985 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 D40FB4BA7985 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=aDqF8+pJAFOdwJ5E4gUPmnwb158qY2Q78gVdpDlErZPjo539zypIJLV8UFL0CrLpE8M5+mlgNb6o2C4yjP7MJOnDff0O0KKh8aG6TcnVmtXHSqYkZpUWGPVjtMMCe83nqpLQKAgVl6k2O4zoRsEKWKblqN/VGo09MQONih5u6Ac= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1786979814; c=relaxed/simple; bh=dAb7EqY7QMQvYgLIXoAIxtFmGwM3CQqpbHiSDiUCABk=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=p1Vd8akcLsyRDprW0CllsQnkQoA3BewZrEbE/XcEox8tWO2u0Pgl4xzyJgOnK0yAzyclI7SYHrGerBeRz5gBmsTVsXIgEU0RicMGb9LXWrLVVctGX+BT8POdrmtVoJXNOdbv0URMSamDREDyKiatvXCkx/uK/BDzLt9ZL1ed2sY= ARC-Authentication-Results: i=1; sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D40FB4BA7985 Received: by simark.ca (Postfix) id 27ED91E16F; 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 05/13] sim/m32r: fix unused variable warning on non-Linux hosts Date: Mon, 17 Aug 2026 11:16:10 -0400 Message-ID: <20260817151646.152571-6-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:191:18: error: unused variable 'cb' [-Werror,-Wunused-variable] 191 | host_callback *cb = STATE_CALLBACK (sd); | ^~ All the uses of `cb' in m32r_trap are inside the TRAP_LINUX_SYSCALL case, which is guarded by `#ifdef __linux__'. Move the declaration inside that case, so that it only exists where it is used. Change-Id: I609850daf7fa60d92856988dffe7e314eb1d8a30 --- sim/m32r/traps.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sim/m32r/traps.c b/sim/m32r/traps.c index 7b98b2453972..bb82ae80e2aa 100644 --- a/sim/m32r/traps.c +++ b/sim/m32r/traps.c @@ -188,7 +188,6 @@ USI m32r_trap (SIM_CPU *current_cpu, PCADDR pc, int num) { SIM_DESC sd = CPU_STATE (current_cpu); - host_callback *cb = STATE_CALLBACK (sd); if (STATE_ENVIRONMENT (sd) == OPERATING_ENVIRONMENT) goto case_default; @@ -217,6 +216,7 @@ m32r_trap (SIM_CPU *current_cpu, PCADDR pc, int num) #ifdef __linux__ case TRAP_LINUX_SYSCALL: { + host_callback *cb = STATE_CALLBACK (sd); CB_SYSCALL s; unsigned int func, arg1, arg2, arg3, arg4, arg5, arg6, arg7; int result, errcode; -- 2.55.0