From 25890a22a929872cf073edab946d23ee5d6b5801 Mon Sep 17 00:00:00 2001 From: Ronen Friedman Date: Wed, 5 Jul 2023 06:01:10 -0500 Subject: [PATCH] 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 --- src/test/rgw/rgw_cr_test.cc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/test/rgw/rgw_cr_test.cc b/src/test/rgw/rgw_cr_test.cc index 37120925291..2c250b390a9 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; } -- 2.39.5