tikv / rocksdb

A library that provides an embeddable, persistent key-value store for fast storage.
http://rocksdb.org
GNU General Public License v2.0
120 stars 93 forks source link

Fix warnings under clang-15 #315

Closed JaySon-Huang closed 2 years ago

JaySon-Huang commented 2 years ago

I tried to compile tikv with clang-15, but following warnings make it failed. Fix the warnings

db/version_set.cc:3111:7: error: variable 'num_empty_non_l0_level' set but not used [-Werror,-Wunused-but-set-variable]
  int num_empty_non_l0_level = 0;
      ^
  gmake[1]: warning: -jN forced in submake: disabling jobserver mode.
  In file included from /data1/jaysonhuang/rust-rocksdb/librocksdb_sys/rocksdb/third-party/folly/folly/detail/Futex.cpp:6:
  In file included from /data1/jaysonhuang/rust-rocksdb/librocksdb_sys/rocksdb/third-party/folly/folly/detail/Futex.h:96:
  In file included from /data1/jaysonhuang/rust-rocksdb/librocksdb_sys/rocksdb/third-party/folly/folly/detail/Futex-inl.h:9:
  In file included from /data1/jaysonhuang/rust-rocksdb/librocksdb_sys/rocksdb/third-party/folly/folly/synchronization/ParkingLot.h:13:
  In file included from /data1/jaysonhuang/rust-rocksdb/librocksdb_sys/rocksdb/third-party/folly/folly/Indestructible.h:12:
  /data1/jaysonhuang/rust-rocksdb/librocksdb_sys/rocksdb/third-party/folly/folly/Traits.h:16:36: error: builtin __has_trivial_copy is deprecated; use __is_trivially_copyable instead [-Werror,-Wdeprecated-builtins]
      : std::integral_constant<bool, __has_trivial_copy(T)> {};
                                     ^
  1 error generated.
 gmake[1]: warning: -jN forced in submake: disabling jobserver mode.
  /data1/jaysonhuang/rust-rocksdb/librocksdb_sys/rocksdb/cache/lru_cache.cc:94:12: error: variable 'count' set but not used [-Werror,-Wunused-but-set-variable]
    uint32_t count = 0;
             ^
  1 error generated.
  gmake[4]: *** [CMakeFiles/rocksdb.dir/cache/lru_cache.cc.o] Error 1
  gmake[4]: *** Waiting for unfinished jobs....
  /data1/jaysonhuang/rust-rocksdb/librocksdb_sys/rocksdb/db/version_edit_handler.cc:29:10: error: variable 'recovered_edits' set but not used [-Werror,-Wunused-but-set-variable]
    size_t recovered_edits = 0;
           ^
  1 error generated.