From: Ronen Friedman Date: Wed, 5 Jul 2023 11:01:10 +0000 (-0500) Subject: test/rgw: annotating variables with maybe_unused X-Git-Tag: v19.3.0~265^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=25890a22a929872cf073edab946d23ee5d6b5801;p=ceph.git 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 --- diff --git a/src/test/rgw/rgw_cr_test.cc b/src/test/rgw/rgw_cr_test.cc index 37120925291a..2c250b390a98 100644 --- a/src/test/rgw/rgw_cr_test.cc +++ b/src/test/rgw/rgw_cr_test.cc @@ -55,12 +55,14 @@ struct TempPool { fmt::format("{}-{}-{}", ::time(nullptr), ::getpid(),num++); TempPool() { - auto r = store->getRados()->get_rados_handle()->pool_create(name.c_str()); + [[maybe_unused]] auto r = + store->getRados()->get_rados_handle()->pool_create(name.c_str()); assert(r == 0); } ~TempPool() { - auto r = store->getRados()->get_rados_handle()->pool_delete(name.c_str()); + [[maybe_unused]] auto r = + store->getRados()->get_rados_handle()->pool_delete(name.c_str()); assert(r == 0); } @@ -70,8 +72,9 @@ struct TempPool { operator librados::IoCtx() { librados::IoCtx ioctx; - auto r = store->getRados()->get_rados_handle()->ioctx_create(name.c_str(), - ioctx); + [[maybe_unused]] auto r = + store->getRados()->get_rados_handle()->ioctx_create(name.c_str(), + ioctx); assert(r == 0); return ioctx; }