Skip to content

Commit 25890a2

Browse files
committed
test/rgw: annotating variables with maybe_unused
Some variables in test/rgw/rgw_cr_test.cc are only used in asserts, while this file is also used in builds without NDEBUG set. Adding the [[maybe_unused]] attribute clears the compilation warnings. Signed-off-by: Ronen Friedman <[email protected]>
1 parent e509829 commit 25890a2

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/test/rgw/rgw_cr_test.cc

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,14 @@ struct TempPool {
5555
fmt::format("{}-{}-{}", ::time(nullptr), ::getpid(),num++);
5656

5757
TempPool() {
58-
auto r = store->getRados()->get_rados_handle()->pool_create(name.c_str());
58+
[[maybe_unused]] auto r =
59+
store->getRados()->get_rados_handle()->pool_create(name.c_str());
5960
assert(r == 0);
6061
}
6162

6263
~TempPool() {
63-
auto r = store->getRados()->get_rados_handle()->pool_delete(name.c_str());
64+
[[maybe_unused]] auto r =
65+
store->getRados()->get_rados_handle()->pool_delete(name.c_str());
6466
assert(r == 0);
6567
}
6668

@@ -70,8 +72,9 @@ struct TempPool {
7072

7173
operator librados::IoCtx() {
7274
librados::IoCtx ioctx;
73-
auto r = store->getRados()->get_rados_handle()->ioctx_create(name.c_str(),
74-
ioctx);
75+
[[maybe_unused]] auto r =
76+
store->getRados()->get_rados_handle()->ioctx_create(name.c_str(),
77+
ioctx);
7578
assert(r == 0);
7679
return ioctx;
7780
}

0 commit comments

Comments
 (0)