From patchwork Sat May 1 03:06:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Antonio Quartulli X-Patchwork-Id: 1787 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director9.mail.ord1d.rsapps.net ([172.30.191.6]) by backend30.mail.ord1d.rsapps.net with LMTP id iLPrBZFSjWDbJQAAIUCqbw (envelope-from ) for ; Sat, 01 May 2021 09:07:29 -0400 Received: from proxy1.mail.ord1d.rsapps.net ([172.30.191.6]) by director9.mail.ord1d.rsapps.net with LMTP id oOG5BZFSjWAxDgAAalYnBA (envelope-from ) for ; Sat, 01 May 2021 09:07:29 -0400 Received: from smtp14.gate.ord1d ([172.30.191.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy1.mail.ord1d.rsapps.net with LMTPS id wKpnBZFSjWCXLAAAasrz9Q (envelope-from ) for ; Sat, 01 May 2021 09:07:29 -0400 X-Spam-Threshold: 95 X-Spam-Score: 0 X-Spam-Flag: NO X-Virus-Scanned: OK X-Orig-To: openvpnslackdevel@openvpn.net X-Originating-Ip: [216.105.38.7] Authentication-Results: smtp14.gate.ord1d.rsapps.net; iprev=pass policy.iprev="216.105.38.7"; spf=pass smtp.mailfrom="openvpn-devel-bounces@lists.sourceforge.net" smtp.helo="lists.sourceforge.net"; dkim=fail (signature verification failed) header.d=sourceforge.net; dkim=fail (signature verification failed) header.d=sf.net; dmarc=none (p=nil; dis=none) header.from=unstable.cc X-Suspicious-Flag: YES X-Classification-ID: 2e2ab676-aa7e-11eb-8191-525400504bae-1-1 Received: from [216.105.38.7] ([216.105.38.7:40248] helo=lists.sourceforge.net) by smtp14.gate.ord1d.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id 94/4D-00999-0925D806; Sat, 01 May 2021 09:07:28 -0400 Received: from [127.0.0.1] (helo=sfs-ml-4.v29.lw.sourceforge.com) by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.90_1) (envelope-from ) id 1lcpKS-0002eL-5s; Sat, 01 May 2021 13:06:40 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lcpKP-0002eB-1G for openvpn-devel@lists.sourceforge.net; Sat, 01 May 2021 13:06:37 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:Content-Type:MIME-Version :References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=TbAs8YPSyBz0c3ZnXYwrxpAZbMLBIzFGG8F0MQtsWgs=; b=V0nlF1tK/2XFnNf5NRmrTvjcjH e2hFtKfIxHJYBIwbeLpdjQx4Czfp3PgCLs3zwYIi0lvEnTgevdCUITQ5r88G1CgDcN2OPmtL7qrBV eWpZ2b6cLwr7BReyN0uD4cyP0L1VEq9odnAt76EH9UjIG04f02/W95XqDXdhtF80iTPk=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=TbAs8YPSyBz0c3ZnXYwrxpAZbMLBIzFGG8F0MQtsWgs=; b=KfygNnfr+2BGaEUuzg//JDvymo HV91BK/22RqKABQp0R3y9s5C0GcS+QJ3Ym4ojVIBhYZVQviAi+Msg98zHG1Il+bueLdAAdXpGmxpm 4igXKQ0NaJA/5UiawwQFXUH0MORhQ0CJZC1hhw04nlhSwX0GvGnOtudXolX7RMeAfQvo=; Received: from s2.neomailbox.net ([5.148.176.60]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.3) id 1lcpKK-0001vM-Ua for openvpn-devel@lists.sourceforge.net; Sat, 01 May 2021 13:06:37 +0000 From: Antonio Quartulli To: openvpn-devel@lists.sourceforge.net Date: Sat, 1 May 2021 15:06:39 +0200 Message-Id: <20210501130640.9330-3-a@unstable.cc> In-Reply-To: <20210501130640.9330-1-a@unstable.cc> References: <20210501130640.9330-1-a@unstable.cc> MIME-Version: 1.0 X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URIs: openvpn.net] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-Headers-End: 1lcpKK-0001vM-Ua Subject: [Openvpn-devel] [PATCH 2/3] windows: define variable only where used X-BeenThere: openvpn-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Antonio Quartulli Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox From: Antonio Quartulli warn_used is a static variable but that is used only under certain conditions. These conditions do not apply for Windows and therefore mingw is spitting a warning for unused variable. Move variable declaration inside code block that uses it. Fixes: run_command.c: In function ‘openvpn_popen’: run_command.c:236:17: warning: unused variable ‘warn_shown’ [-Wunused-variable] 236 | static bool warn_shown = false; | ^~~~~~~~~~ Signed-off-by: Antonio Quartulli Acked-By: Arne Schwabe --- src/openvpn/run_command.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openvpn/run_command.c b/src/openvpn/run_command.c index 34f95c5c..650876c1 100644 --- a/src/openvpn/run_command.c +++ b/src/openvpn/run_command.c @@ -233,11 +233,11 @@ openvpn_popen(const struct argv *a, const struct env_set *es) { struct gc_arena gc = gc_new(); int ret = -1; - static bool warn_shown = false; if (a && a->argv[0]) { #if defined(ENABLE_FEATURE_EXECVE) + static bool warn_shown = false; if (script_security() >= SSEC_BUILT_IN) { const char *cmd = a->argv[0];