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 0FCE57F653; Thu, 26 May 2022 11:41:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1653565307; bh=ayS1FQwgBjBftmEoMoz6IW7iYtNPffWv7etVOkBsa/c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=b5ef9FE5y2n5Zp+MTu18iJK5HVoyPwn+cmDQzXTGFAwTB+O15eN2dn0pc9psz6F48 HFTpIMIwCcK/98OAPkSTNq7Lz5BulK6xFa8ZHZeeLOh5N5j+5ZBHdVIkajKsbjxhSz jhliEtPru64fyKhaDexCA/SeIGAwOOPN6BTq1tRjxbthxJhb62BQEU+Bq6u3H0EZs0 36dQlOvLfvni6YEPmGUpUOxuTxFOQBk7gKuaKo9mTh5DJlV0LIfYeB25HOSQyP27J/ q1c2R/DU3wrox6ExVuqcNVjZNTLus87Okan2wJMGpoqsxaP9XfOd6t80LMmWMY4mpZ RZqUalBnZKe5w== From: Ammar Faizi To: GNU/Weeb Mailing List Cc: Ammar Faizi , Nick Mathewson Subject: [PATCH tor v1 2/6] connection_or: Fix clang-15 complaint (unused variable) Date: Thu, 26 May 2022 18:41:26 +0700 Message-Id: <20220526114130.285353-3-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: clang-15 throws the following complaints: ``` src/core/or/connection_or.c:1075:7: error: variable 'n_old' set but not used [-Werror,-Wunused-but-set-variable] int n_old = 0, n_inprogress = 0, n_canonical = 0, n_other = 0; ^ src/core/or/connection_or.c:1075:53: error: variable 'n_other' set but not used [-Werror,-Wunused-but-set-variable] int n_old = 0, n_inprogress = 0, n_canonical = 0, n_other = 0; ^ src/core/or/connection_or.c:1075:18: error: variable 'n_inprogress' set but not used [-Werror,-Wunused-but-set-variable] int n_old = 0, n_inprogress = 0, n_canonical = 0, n_other = 0; ^ ``` These variables firstly introduced in commit df608fef4522 ("Checkpoint my big bug-891 patch."). Now they are no longer used. But I personally think these variables may still be useful for counting purpose someday. As such add `(void)` cast to them to suppress the clang complaints. Cc: Nick Mathewson Signed-off-by: Ammar Faizi --- src/core/or/connection_or.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/core/or/connection_or.c b/src/core/or/connection_or.c index 0018b1dfd8..5a387b54fe 100644 --- a/src/core/or/connection_or.c +++ b/src/core/or/connection_or.c @@ -1075,6 +1075,10 @@ connection_or_group_set_badness_(smartlist_t *group, int force) int n_old = 0, n_inprogress = 0, n_canonical = 0, n_other = 0; time_t now = time(NULL); + (void)n_old; + (void)n_inprogress; + (void)n_other; + /* Pass 1: expire everything that's old, and see what the status of * everything else is. */ SMARTLIST_FOREACH_BEGIN(group, or_connection_t *, or_conn) { -- Ammar Faizi