Merge pull request #19820 from yaozongyou/silence-maybe-uninitialized-warning

osd: silence maybe-uninitialized false positives

Reviewed-by: Kefu Chai <kchai@redhat.com>
This commit is contained in:
Sage Weil 2018-01-10 07:00:31 -06:00 committed by GitHub
commit 58170f5027
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5243,7 +5243,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.