This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a commit to branch 9.2.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/9.2.x by this push:
     new 80c58f08a Fix unused-but-set-variable warnings by llvm-15 (#9106)
80c58f08a is described below

commit 80c58f08a3d22093d353cb86962330f2f0206e01
Author: Masaori Koshiba <[email protected]>
AuthorDate: Tue Sep 27 08:39:44 2022 +0900

    Fix unused-but-set-variable warnings by llvm-15 (#9106)
    
    (cherry picked from commit a4de562e5043ec5e632840b8bbac07665f88cac4)
---
 iocore/cache/Cache.cc               | 5 -----
 iocore/cache/Store.cc               | 5 -----
 proxy/http/remap/RemapConfig.cc     | 2 +-
 proxy/logging/LogObject.cc          | 3 ---
 src/traffic_cache_tool/CacheDefs.cc | 2 --
 tests/gold_tests/tls/ssl-post.c     | 4 ----
 6 files changed, 1 insertion(+), 20 deletions(-)

diff --git a/iocore/cache/Cache.cc b/iocore/cache/Cache.cc
index ca5fcc609..797c08d77 100644
--- a/iocore/cache/Cache.cc
+++ b/iocore/cache/Cache.cc
@@ -2889,7 +2889,6 @@ cplist_reconfigure()
       }
 
       int64_t size_to_alloc = size_in_blocks - cp->size;
-      int disk_full         = 0;
       for (int i = 0; (i < gndisks) && size_to_alloc; i++) {
         int disk_no = sorted_vols[i];
         ink_assert(cp->disk_vols[sorted_vols[gndisks - 1]]);
@@ -2922,10 +2921,6 @@ cplist_reconfigure()
           }
         } while ((size_diff > 0));
 
-        if (!dpb) {
-          disk_full++;
-        }
-
         size_to_alloc = size_in_blocks - cp->size;
       }
 
diff --git a/iocore/cache/Store.cc b/iocore/cache/Store.cc
index 85a9d556b..8d00cc44b 100644
--- a/iocore/cache/Store.cc
+++ b/iocore/cache/Store.cc
@@ -303,7 +303,6 @@ Result
 Store::read_config()
 {
   int n_dsstore   = 0;
-  int ln          = 0;
   int i           = 0;
   const char *err = nullptr;
   Span *sd = nullptr, *cur = nullptr;
@@ -326,10 +325,6 @@ Store::read_config()
   while ((len = ink_file_fd_readline(fd, sizeof(line), line)) > 0) {
     const char *path;
     const char *seed = nullptr;
-    // update lines
-
-    ++ln;
-
     // Because the SimpleTokenizer is a bit too simple, we have to normalize 
whitespace.
     for (char *spot = line, *limit = line + len; spot < limit; ++spot) {
       if (ParseRules::is_space(*spot)) {
diff --git a/proxy/http/remap/RemapConfig.cc b/proxy/http/remap/RemapConfig.cc
index 2f435f60b..80999fd6e 100644
--- a/proxy/http/remap/RemapConfig.cc
+++ b/proxy/http/remap/RemapConfig.cc
@@ -148,7 +148,7 @@ is_inkeylist(const char *key, ...)
   va_start(ap, key);
 
   const char *str = va_arg(ap, const char *);
-  for (unsigned idx = 1; str; idx++) {
+  while (str) {
     if (!strcasecmp(key, str)) {
       va_end(ap);
       return true;
diff --git a/proxy/logging/LogObject.cc b/proxy/logging/LogObject.cc
index f9a4e2ce0..db8ea94d5 100644
--- a/proxy/logging/LogObject.cc
+++ b/proxy/logging/LogObject.cc
@@ -1128,8 +1128,6 @@ LogObjectManager::open_local_pipes()
 void
 LogObjectManager::transfer_objects(LogObjectManager &old_mgr)
 {
-  unsigned num_kept_objects = 0;
-
   Debug("log-config-transfer", "transferring objects from LogObjectManager %p, 
to %p", &old_mgr, this);
 
   if (is_debug_tag_set("log-config-transfer")) {
@@ -1172,7 +1170,6 @@ LogObjectManager::transfer_objects(LogObjectManager 
&old_mgr)
         if (new_obj->refcount_dec() == 0) {
           delete new_obj;
         }
-        ++num_kept_objects;
         break;
       }
     }
diff --git a/src/traffic_cache_tool/CacheDefs.cc 
b/src/traffic_cache_tool/CacheDefs.cc
index 3bc692dea..ce7edeb12 100644
--- a/src/traffic_cache_tool/CacheDefs.cc
+++ b/src/traffic_cache_tool/CacheDefs.cc
@@ -542,10 +542,8 @@ Stripe::walk_bucket_chain(int s)
     CacheDirEntry *p = nullptr;
     auto *dir_b      = dir_bucket(b, seg);
     CacheDirEntry *e = dir_b;
-    int len          = 0;
 
     while (e) {
-      len++;
       int i = dir_to_offset(e, seg);
       if (b_bitset.test(i)) {
         std::cout << "bit already set in "
diff --git a/tests/gold_tests/tls/ssl-post.c b/tests/gold_tests/tls/ssl-post.c
index 4af8f7507..5823e3477 100644
--- a/tests/gold_tests/tls/ssl-post.c
+++ b/tests/gold_tests/tls/ssl-post.c
@@ -105,8 +105,6 @@ spawn_same_session_send(void *arg)
 
   SSL_set_fd(ssl, sfd);
   int ret            = SSL_connect(ssl);
-  int read_count     = 0;
-  int write_count    = 1;
   int write_ret      = -1;
   int post_write_ret = -1;
 
@@ -120,12 +118,10 @@ spawn_same_session_send(void *arg)
     case SSL_ERROR_WANT_READ:
     case SSL_ERROR_WANT_ACCEPT:
       FD_SET(sfd, &reads);
-      read_count++;
       break;
     case SSL_ERROR_WANT_CONNECT:
     case SSL_ERROR_WANT_WRITE:
       FD_SET(sfd, &writes);
-      write_count++;
       break;
     case SSL_ERROR_SYSCALL:
     case SSL_ERROR_SSL:

Reply via email to