From: Kefu Chai Date: Mon, 16 Aug 2021 09:17:48 +0000 (+0800) Subject: os/bluestore/BlueStore: make maybe unused variable [[maybe_unused]] X-Git-Tag: v17.1.0~1111^2~4 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=436e9309ed0d09da254c843509ac395d625a9e3e;p=ceph-ci.git 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 --- 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];