From 6ba4717f3594756c8e8ff4e38adc0d5453c77581 Mon Sep 17 00:00:00 2001 From: akankshamahajan Date: Tue, 9 May 2023 15:43:43 -0700 Subject: [PATCH] Fix build error: variable 'base_level' may be uninitialized (#11435) Summary: Fix build error: variable 'base_level' may be uninitialized ``` db_impl_compaction_flush.cc:1195:21: error: variable 'base_level' may be uninitialized when used here [-Werror,-Wconditional-uninitialized] level = base_level; ``` ^~~~~~~~~~ Pull Request resolved: https://github.com/facebook/rocksdb/pull/11435 Test Plan: CircleCI jobs Reviewed By: cbi42 Differential Revision: D45708176 Pulled By: akankshamahajan15 fbshipit-source-id: 851b1205b22b63d728495e5735fa91b0ad8e012b --- db/db_impl/db_impl_compaction_flush.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/db_impl/db_impl_compaction_flush.cc b/db/db_impl/db_impl_compaction_flush.cc index 39a833919..84433a41d 100644 --- a/db/db_impl/db_impl_compaction_flush.cc +++ b/db/db_impl/db_impl_compaction_flush.cc @@ -1170,7 +1170,7 @@ Status DBImpl::CompactRangeInternal(const CompactRangeOptions& options, // at L1 (or LBase), if applicable. int level = first_overlapped_level; final_output_level = level; - int output_level, base_level; + int output_level = 0, base_level = 0; while (level < max_overlapped_level || level == 0) { output_level = level + 1; if (cfd->ioptions()->level_compaction_dynamic_level_bytes &&