diff --git a/file/prefetch_test.cc b/file/prefetch_test.cc index de896a99e..fa3c2138d 100644 --- a/file/prefetch_test.cc +++ b/file/prefetch_test.cc @@ -168,7 +168,7 @@ TEST_P(PrefetchTest, Basic) { // count the keys { auto iter = std::unique_ptr(db_->NewIterator(ReadOptions())); - int num_keys = 0; + [[maybe_unused]] int num_keys = 0; for (iter->SeekToFirst(); iter->Valid(); iter->Next()) { num_keys++; } diff --git a/memtable/inlineskiplist_test.cc b/memtable/inlineskiplist_test.cc index 4523aa770..2261136fa 100644 --- a/memtable/inlineskiplist_test.cc +++ b/memtable/inlineskiplist_test.cc @@ -570,7 +570,7 @@ class TestState { static void ConcurrentReader(void* arg) { TestState* state = reinterpret_cast(arg); Random rnd(state->seed_); - int64_t reads = 0; + [[maybe_unused]] int64_t reads = 0; state->Change(TestState::RUNNING); while (!state->quit_flag_.load(std::memory_order_acquire)) { state->t_.ReadStep(&rnd); diff --git a/memtable/skiplist_test.cc b/memtable/skiplist_test.cc index d35bc856d..b74e26cb2 100644 --- a/memtable/skiplist_test.cc +++ b/memtable/skiplist_test.cc @@ -344,7 +344,7 @@ class TestState { static void ConcurrentReader(void* arg) { TestState* state = reinterpret_cast(arg); Random rnd(state->seed_); - int64_t reads = 0; + [[maybe_unused]] int64_t reads = 0; state->Change(TestState::RUNNING); while (!state->quit_flag_.load(std::memory_order_acquire)) { state->t_.ReadStep(&rnd);