public inbox for [email protected]
 help / color / mirror / Atom feed
From: Ammar Faizi <[email protected]>
To: GNU/Weeb Mailing List <[email protected]>
Cc: Ammar Faizi <[email protected]>,
	Nick Mathewson <[email protected]>
Subject: [PATCH tor v1 1/6] channel: Fix clang-15 complaint (unused variable)
Date: Thu, 26 May 2022 18:41:25 +0700	[thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>

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 <[email protected]>
Signed-off-by: Ammar Faizi <[email protected]>
---
 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


  reply	other threads:[~2022-05-26 11:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-26 11:41 [GIT PULL tor v1 0/6] Build fixes for clang-15 Ammar Faizi
2022-05-26 11:41 ` Ammar Faizi [this message]
2022-05-26 11:41 ` [PATCH tor v1 2/6] connection_or: Fix clang-15 complaint (unused variable) Ammar Faizi
2022-05-26 11:41 ` [PATCH tor v1 3/6] routerlist: " Ammar Faizi
2022-05-26 11:41 ` [PATCH tor v1 4/6] compat_libevent: " Ammar Faizi
2022-05-26 11:41 ` [PATCH tor v1 5/6] test/bench: " Ammar Faizi
2022-05-26 11:41 ` [PATCH tor v1 6/6] test/test_hs_descriptor: Don't invoke GCC warning when compiling with clang Ammar Faizi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox