From b637f7b8f1c6a6563ca548378f51faa6ee9ceb24 Mon Sep 17 00:00:00 2001 From: Yao Zongyou Date: Sun, 7 Jan 2018 16:25:09 +0800 Subject: [PATCH] osd: silence maybe-uninitialized false positives Signed-off-by: Yao Zongyou --- src/osd/PrimaryLogPG.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index 48bf42eb4cf..67e071048bf 100644 --- a/src/osd/PrimaryLogPG.cc +++ b/src/osd/PrimaryLogPG.cc @@ -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 maybe_crc; + // The initialisation below is required to silence a false positive + // -Wmaybe-uninitialized warning + boost::optional 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. -- 2.39.5