Hi,

when building GCC with clang, it warns that the private member suffix
in class ltrans_file_cache (defined in lto-ltrans-cache.h) is not used
which indeed looks like it is the case.  This patch therefore removes
it along with its initialization in the constructor.

Bootstrapped and tested on x86_64-linx.  OK for master?

Alternatively, as with all of these clang warning issues, I'm
perfectly happy to add an entry to contrib/filter-clang-warnings.py to
ignore the warning instead.

Thanks,

Martin


gcc/ChangeLog:

2025-06-24  Martin Jambor  <mjam...@suse.cz>

        * lto-ltrans-cache.h (class ltrans_file_cache): Remove member prefix.
        * lto-ltrans-cache.cc (ltrans_file_cache::ltrans_file_cache): Do
        not initialize member prefix.
---
 gcc/lto-ltrans-cache.cc | 3 +--
 gcc/lto-ltrans-cache.h  | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/gcc/lto-ltrans-cache.cc b/gcc/lto-ltrans-cache.cc
index c57775fae85..91af6ed6f82 100644
--- a/gcc/lto-ltrans-cache.cc
+++ b/gcc/lto-ltrans-cache.cc
@@ -210,8 +210,7 @@ write_cache_item (FILE* f, ltrans_file_cache::item *item, 
const char* dir)
 ltrans_file_cache::ltrans_file_cache (const char* dir, const char* prefix,
                                      const char* suffix,
                                      size_t soft_cache_size):
-  dir (dir), prefix (prefix), suffix (suffix),
-  soft_cache_size (soft_cache_size)
+  dir (dir), suffix (suffix),  soft_cache_size (soft_cache_size)
 {
   if (!dir) return;
 
diff --git a/gcc/lto-ltrans-cache.h b/gcc/lto-ltrans-cache.h
index 5fef44bae53..fdb7a389435 100644
--- a/gcc/lto-ltrans-cache.h
+++ b/gcc/lto-ltrans-cache.h
@@ -122,8 +122,7 @@ private:
   std::map<checksum_t, item*> map_checksum;
   std::map<std::string, item*> map_input;
 
-  /* Cached filenames are in format "prefix%d[.ltrans]suffix".  */
-  const char* prefix;
+  /* Cached filenames are in format "cache_prefix%d[.ltrans]suffix".  */
   const char* suffix;
 
   /* If cache items count is larger, prune deletes old items.  */
-- 
2.49.0

Reply via email to