[11/12] rules.pl: Add workaround to hide a warning about an only once used variable.
Message ID | 20220214184257.2406-11-stefan.schantl@ipfire.org |
---|---|
State | Accepted |
Commit | 0564b0c7c98cac0e07f04f8d9e026d9f033fd012 |
Headers |
Return-Path: <development-bounces@lists.ipfire.org> Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4JyCm53hDyz3xgD for <patchwork@web04.haj.ipfire.org>; Mon, 14 Feb 2022 18:43:33 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4JyClr6ytKz5R3; Mon, 14 Feb 2022 18:43:20 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4JyClr62lkz30Hs; Mon, 14 Feb 2022 18:43:20 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4JyClq0jRnz2xLr for <development@lists.ipfire.org>; Mon, 14 Feb 2022 18:43:19 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4JyCln6vjZz5Hc; Mon, 14 Feb 2022 18:43:17 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1644864198; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=v2I/jYgJM11ucTkwrfMcMd9G2UBmbOjXKcmasXbTT5w=; b=YypVoGBa/518NaF3MKSvelhPbvsNhOQM5XqL05JilwUS9iSh+HNXzo1inookm02SRgvPB1 aK5CeabvEMuyJ5Ag== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1644864198; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=v2I/jYgJM11ucTkwrfMcMd9G2UBmbOjXKcmasXbTT5w=; b=h5bjzN46JbzkAzLh43FU1wJ7G+oAbAM4753JYo/t3FeF/CWCpHicLqkQGBBYNGbEedsyxU UqNNw1ESKKD15kTvCKi1Spr4t+MvdF7GXKKBZjpw/SiL7uG9l4XUmNzCMvf6mi3il6ipSq HZS/7n0Hi+VqkAcxdb/cw0N1K9+9QW9TXsYknyKmdqdJHf6nWusRHgx0wo1nkD7fB9RX4f tpnEea4XHnAIucAGveeKT0040nMak31gva7pJ0/S7MkV0Lq2XLJBHJ2ZVflzctSqRUsyqT AuvDT5ni0oFL9rBf0josvZiXIXU9gS2la4D0PM0S9ZadOqYEQwcQ7F50IeQLew== From: Stefan Schantl <stefan.schantl@ipfire.org> To: development@lists.ipfire.org Subject: [PATCH 11/12] rules.pl: Add workaround to hide a warning about an only once used variable. Date: Mon, 14 Feb 2022 19:42:55 +0100 Message-Id: <20220214184257.2406-11-stefan.schantl@ipfire.org> In-Reply-To: <20220214184257.2406-1-stefan.schantl@ipfire.org> References: <20220214184257.2406-1-stefan.schantl@ipfire.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFire development talk <development.lists.ipfire.org> List-Unsubscribe: <https://lists.ipfire.org/mailman/options/development>, <mailto:development-request@lists.ipfire.org?subject=unsubscribe> List-Archive: <http://lists.ipfire.org/pipermail/development/> List-Post: <mailto:development@lists.ipfire.org> List-Help: <mailto:development-request@lists.ipfire.org?subject=help> List-Subscribe: <https://lists.ipfire.org/mailman/listinfo/development>, <mailto:development-request@lists.ipfire.org?subject=subscribe> Errors-To: development-bounces@lists.ipfire.org Sender: "Development" <development-bounces@lists.ipfire.org> |
Series |
[01/12] location-functions.pl: Rename and set the location for exported databases to "/var/lib/location/ipset/".
|
|
Commit Message
Stefan Schantl
14 Feb 2022, 6:42 p.m. UTC
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
---
config/firewall/rules.pl | 4 ++++
1 file changed, 4 insertions(+)
Comments
Ugly, but I see why this is necessary. Reviewed-by: Peter Müller <peter.mueller@ipfire.org> > Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org> > --- > config/firewall/rules.pl | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/config/firewall/rules.pl b/config/firewall/rules.pl > index 162781f7a..c0878059a 100644 > --- a/config/firewall/rules.pl > +++ b/config/firewall/rules.pl > @@ -109,6 +109,10 @@ my $POLICY_INPUT_ACTION = $fwoptions{"FWPOLICY2"}; > my $POLICY_FORWARD_ACTION = $fwoptions{"FWPOLICY"}; > my $POLICY_OUTPUT_ACTION = $fwoptions{"FWPOLICY1"}; > > +#workaround to suppress a warning when a variable is used only once > +my @dummy = ( $Location::Functions::ipset_db_directory ); > +undef (@dummy); > + > # MAIN > &main(); >
Is it not possible to disable this kind of warning entirely? It is a stupid idea. Does declaring the variable as some sort of constant help? -Michael > On 14 Feb 2022, at 18:42, Stefan Schantl <stefan.schantl@ipfire.org> wrote: > > Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org> > --- > config/firewall/rules.pl | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/config/firewall/rules.pl b/config/firewall/rules.pl > index 162781f7a..c0878059a 100644 > --- a/config/firewall/rules.pl > +++ b/config/firewall/rules.pl > @@ -109,6 +109,10 @@ my $POLICY_INPUT_ACTION = $fwoptions{"FWPOLICY2"}; > my $POLICY_FORWARD_ACTION = $fwoptions{"FWPOLICY"}; > my $POLICY_OUTPUT_ACTION = $fwoptions{"FWPOLICY1"}; > > +#workaround to suppress a warning when a variable is used only once > +my @dummy = ( $Location::Functions::ipset_db_directory ); > +undef (@dummy); > + > # MAIN > &main(); > > -- > 2.30.2 >
diff --git a/config/firewall/rules.pl b/config/firewall/rules.pl index 162781f7a..c0878059a 100644 --- a/config/firewall/rules.pl +++ b/config/firewall/rules.pl @@ -109,6 +109,10 @@ my $POLICY_INPUT_ACTION = $fwoptions{"FWPOLICY2"}; my $POLICY_FORWARD_ACTION = $fwoptions{"FWPOLICY"}; my $POLICY_OUTPUT_ACTION = $fwoptions{"FWPOLICY1"}; +#workaround to suppress a warning when a variable is used only once +my @dummy = ( $Location::Functions::ipset_db_directory ); +undef (@dummy); + # MAIN &main();