From 436e9309ed0d09da254c843509ac395d625a9e3e Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Mon, 16 Aug 2021 17:17:48 +0800 Subject: [PATCH] os/bluestore/BlueStore: make maybe unused variable [[maybe_unused]] cct is defined so it can be used by dout(), but when the source code is compiled for crimson, dout() does not use cct at all, so in that case, compiler complains like: ../src/os/bluestore/BlueStore.cc:17413:8: warning: unused variable 'cct' [-Wunused-variable] auto cct = onode->c->store->cct; ^ 1 warning generated. in this change, cct is marked with [[maybe_unused]] to silence this warning. Signed-off-by: Kefu Chai --- src/os/bluestore/BlueStore.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index 4f0b410e478..926b61ed3b6 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -17410,7 +17410,7 @@ int BlueStore::restore_allocator(Allocator* allocator, uint64_t *num, uint64_t * //------------------------------------------------------------------------- void BlueStore::ExtentMap::provide_shard_info_to_onode(bufferlist v, uint32_t shard_id) { - auto cct = onode->c->store->cct; + [[maybe_unused]] auto cct = onode->c->store->cct; auto path = onode->c->store->path; if (shard_id < shards.size()) { auto p = &shards[shard_id]; -- 2.39.5