From: Brad Hubbard Date: Fri, 1 Dec 2017 05:47:58 +0000 (+1000) Subject: rgw: Silence maybe-uninitialized false positives X-Git-Tag: v13.0.2~735^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a6547d647eac06da52eda885ec2cc24b44839252;p=ceph.git rgw: Silence maybe-uninitialized false positives Signed-off-by: Brad Hubbard --- diff --git a/src/rgw/rgw_sync_log_trim.cc b/src/rgw/rgw_sync_log_trim.cc index 418441996f2b4..fb95f4bc01c2c 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) {