]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix build with clang v15.0.6 [-Wunused-but-set-variable] (#1247)
authorgkinkie@gmail.com <kinkie@squid-cache.org>
Fri, 27 Jan 2023 14:43:41 +0000 (14:43 +0000)
committerAmos Jeffries <yadij@users.noreply.github.com>
Thu, 23 Feb 2023 12:34:13 +0000 (01:34 +1300)
clang v15.0.6 distributed with Fedora Rawhide complains about a variable
that is updated but never used:

    net_db.cc:230:9: error: variable 'removed' set but not used
    [-Werror,-Wunused-but-set-variable]`

src/icmp/net_db.cc

index 4f1755b6a5242e7a24dc5f5bd16501e5c675bb15..fa852f6c5d3b4b90f61596795a655bba5141255d 100644 (file)
@@ -230,7 +230,6 @@ netdbPurgeLRU(void)
     netdbEntry **list;
     int k = 0;
     int list_count = 0;
-    int removed = 0;
     list = (netdbEntry **)xcalloc(netdbEntry::UseCount(), sizeof(netdbEntry *));
     hash_first(addr_table);
 
@@ -250,8 +249,6 @@ netdbPurgeLRU(void)
             break;
 
         netdbRelease(*(list + k));
-
-        ++removed;
     }
 
     xfree(list);