From: codeoos <946118747@qq.com> Date: Thu, 19 Jan 2023 21:59:48 +0000 (-0800) Subject: Fix error maybe-uninitialized #11100 (#11101) X-Git-Tag: v7.10.2~13 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f4a5446cab9a5797758e5fd491917280a39359ca;p=rocksdb.git Fix error maybe-uninitialized #11100 (#11101) Summary: In this issue [11100](https://github.com/facebook/rocksdb/issues/11100) I try to upgrade dependencies of [BaikalDB](https://github.com/baidu/BaikalDB) and tool chain to gcc-12.I found that when I build rocksdb v6.26.0(maybe I can use newer version),I found that in file trace_replay/trace_replay.cc,the compiler tell me "error mybe-uninitialized".I dound that it can be fixed very easy,so I make this pull request. Pull Request resolved: https://github.com/facebook/rocksdb/pull/11101 Reviewed By: ajkr Differential Revision: D42583031 Pulled By: cbi42 fbshipit-source-id: 7f399f09441a30fe88b83cec5e2fd9885bad5c06 --- diff --git a/trace_replay/trace_replay.cc b/trace_replay/trace_replay.cc index 37b95852b..c681e374c 100644 --- a/trace_replay/trace_replay.cc +++ b/trace_replay/trace_replay.cc @@ -317,7 +317,7 @@ Status TracerHelper::DecodeTraceRecord(Trace* trace, int trace_file_version, cf_ids.reserve(multiget_size); multiget_keys.reserve(multiget_size); for (uint32_t i = 0; i < multiget_size; i++) { - uint32_t tmp_cfid; + uint32_t tmp_cfid = 0; Slice tmp_key; GetFixed32(&cfids_payload, &tmp_cfid); GetLengthPrefixedSlice(&keys_payload, &tmp_key);