]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
osd: silence maybe-uninitialized false positives
authorYao Zongyou <yaozongyou@vip.qq.com>
Sun, 7 Jan 2018 08:25:09 +0000 (16:25 +0800)
committerYao Zongyou <yaozongyou@vip.qq.com>
Sun, 7 Jan 2018 08:25:09 +0000 (16:25 +0800)
Signed-off-by: Yao Zongyou <yaozongyou@vip.qq.com>
src/osd/PrimaryLogPG.cc

index 48bf42eb4cf99e82c91ab692369796cc4057269c..67e071048bffff21302c52cad572bdcbbce41204 100644 (file)
@@ -5063,7 +5063,9 @@ int PrimaryLogPG::do_read(OpContext *ctx, OSDOp& osd_op) {
     // a read operation of 0 bytes does *not* do nothing, this is why
     // the trimmed_read boolean is needed
   } else if (pool.info.is_erasure()) {
-    boost::optional<uint32_t> maybe_crc;
+    // The initialisation below is required to silence a false positive
+    // -Wmaybe-uninitialized warning
+    boost::optional<uint32_t> maybe_crc = boost::make_optional(false, uint32_t());
     // If there is a data digest and it is possible we are reading
     // entire object, pass the digest.  FillInVerifyExtent will
     // will check the oi.size again.