From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on gnuweeb.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NO_DNS_FOR_FROM,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 Received: from integral2.. (unknown [125.163.245.210]) by gnuweeb.org (Postfix) with ESMTPSA id 869667F66D; Thu, 26 May 2022 11:41:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1653565305; bh=NMdWiEyZlM3AnAulz3jj6NoKOMlBMdV6vfnbC5ZDZaA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mVUS7J3uLt3oKhUy/W85s3oYle2s3MVfVx/LbStelmgx6C3Ic7aojFm2G82kWP7iT fln5D0wXTsnTUuJeCj4U4E7eRe++GUuEjXKcL9vCpX3JweaZl9H5TRfzeRrAhVVEQ0 kUJdU+dARmcJP51rtWkEbF7b4qFesApZpNQfqQBKG2TQZWKyqwWzmq6SSNRfJz4hfH oPOwSWwvQQCzGwMXVnUjUebdS1/V1Zdd0N9o84xW+yu6ztr64Pwhd6d3N+vq62px9V swr9lxMdyhiNletCCVZrT21vzR3Y3YvrJOkTXHv6PgjvBQge/otgT2fpjnw+9On8lh 3274GvPw7C1sQ== From: Ammar Faizi To: GNU/Weeb Mailing List Cc: Ammar Faizi , Nick Mathewson Subject: [PATCH tor v1 1/6] channel: Fix clang-15 complaint (unused variable) Date: Thu, 26 May 2022 18:41:25 +0700 Message-Id: <20220526114130.285353-2-ammarfaizi2@gnuweeb.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220526114130.285353-1-ammarfaizi2@gnuweeb.org> References: <20220526114130.285353-1-ammarfaizi2@gnuweeb.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: Commit faa752f3c9bd3faa ("Adjust the rules for warning about too many connections") added an unused variable @total_dirauth_connections. It results in the following clang-15 complaint: ``` src/core/or/channel.c:752:7: error: variable 'total_dirauth_connections' set but not used [-Werror,-Wunused-but-set-variable] int total_dirauth_connections = 0, total_dirauths = 0; ^ 1 error generated. ``` Fix it by removing the variable. Cc: Nick Mathewson Signed-off-by: Ammar Faizi --- src/core/or/channel.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/core/or/channel.c b/src/core/or/channel.c index c46fa93e58..84f0d7d852 100644 --- a/src/core/or/channel.c +++ b/src/core/or/channel.c @@ -749,7 +749,7 @@ channel_check_for_duplicates(void) { channel_idmap_entry_t **iter; channel_t *chan; - int total_dirauth_connections = 0, total_dirauths = 0; + int total_dirauths = 0; int total_relay_connections = 0, total_relays = 0, total_canonical = 0; int total_half_canonical = 0; int total_gt_one_connection = 0, total_gt_two_connections = 0; @@ -777,8 +777,6 @@ channel_check_for_duplicates(void) connections_to_relay++; total_relay_connections++; - if (is_dirauth) - total_dirauth_connections++; if (chan->is_canonical(chan)) total_canonical++; -- Ammar Faizi