From 5cf18c7634fc65f85a6130429c274d580a507bda Mon Sep 17 00:00:00 2001 From: Jun He Date: Fri, 22 Jul 2022 09:24:13 -0700 Subject: [PATCH] Fix build error due to uninitialized read_req (#10312) Summary: GCC-12 has strick check on variables, and thus build fails when it finds read_req is not properly initialized (-Werror=maybe-uninitialized). Add default value to fix this. Change-Id: Ib8a9085e2d613ee7b943b58a6a58e1bc351725d7 Signed-off-by: Jun He Pull Request resolved: https://github.com/facebook/rocksdb/pull/10312 Reviewed By: riversand963 Differential Revision: D37656997 Pulled By: ajkr fbshipit-source-id: fe47492c913b34b3a03c04beeec9ec57831dcaff --- db/blob/blob_file_reader.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/blob/blob_file_reader.cc b/db/blob/blob_file_reader.cc index cc46f7a76..5e96e7ae9 100644 --- a/db/blob/blob_file_reader.cc +++ b/db/blob/blob_file_reader.cc @@ -414,7 +414,7 @@ void BlobFileReader::MultiGetBlob(const ReadOptions& read_options, assert(blob_reqs[i]->offset >= adjustment); adjustments.push_back(adjustment); - FSReadRequest read_req; + FSReadRequest read_req = {}; read_req.offset = blob_reqs[i]->offset - adjustment; read_req.len = blob_reqs[i]->len + adjustment; read_reqs.emplace_back(read_req);