From a6547d647eac06da52eda885ec2cc24b44839252 Mon Sep 17 00:00:00 2001 From: Brad Hubbard Date: Fri, 1 Dec 2017 15:47:58 +1000 Subject: [PATCH] rgw: Silence maybe-uninitialized false positives Signed-off-by: Brad Hubbard --- src/rgw/rgw_sync_log_trim.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/rgw/rgw_sync_log_trim.cc b/src/rgw/rgw_sync_log_trim.cc index 418441996f2..fb95f4bc01c 100644 --- a/src/rgw/rgw_sync_log_trim.cc +++ b/src/rgw/rgw_sync_log_trim.cc @@ -347,7 +347,9 @@ int take_min_status(CephContext *cct, Iter first, Iter last, std::vector *status) { status->clear(); - boost::optional num_shards; + // The initialisation below is required to silence a false positive + // -Wmaybe-uninitialized warning + boost::optional num_shards = boost::make_optional(false, 0UL); for (auto peer = first; peer != last; ++peer) { const size_t peer_shards = peer->size(); if (!num_shards) { @@ -417,6 +419,7 @@ class BucketTrimInstanceCR : public RGWCoroutine { std::string bucket_instance; const std::string& zone_id; //< my zone id RGWBucketInfo bucket_info; //< bucket instance info to locate bucket indices + int child_ret = 0; using StatusShards = std::vector; std::vector peer_status; //< sync status for each peer @@ -467,7 +470,6 @@ int BucketTrimInstanceCR::operate() } // wait for a response from each peer. all must respond to attempt trim while (num_spawned()) { - int child_ret; yield wait_for_child(); collect(&child_ret, nullptr); if (child_ret < 0) { -- 2.39.5