Skip to content

Commit

Permalink
Initialize variable to avoid warning
Browse files Browse the repository at this point in the history
Summary:
RocksDB debug version failed to build under gcc-4.8.1 on sandcastle with the following error:

```
db/db_compaction_filter_test.cc:570:33: error: ‘snapshot’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
```

Test Plan: make db_compaction_filter_test && ./db_compaction_filter_test

Reviewers: rven, anthony, yhchiang, aekmekji, igor, sdong

Reviewed By: igor, sdong

Subscribers: dhruba, leveldb

Differential Revision: https://reviews.facebook.net/D46725
  • Loading branch information
4tXJ7f committed Sep 11, 2015
1 parent aeb4612 commit 34cedaf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion db/db_compaction_filter_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ TEST_F(DBTestCompactionFilter, CompactionFilterSnapshot) {
DestroyAndReopen(options);

// Put some data.
const Snapshot* snapshot;
const Snapshot* snapshot = nullptr;
for (int table = 0; table < 4; ++table) {
for (int i = 0; i < 10; ++i) {
Put(ToString(table * 100 + i), "val");
Expand All @@ -559,6 +559,7 @@ TEST_F(DBTestCompactionFilter, CompactionFilterSnapshot) {
snapshot = db_->GetSnapshot();
}
}
assert(snapshot != nullptr);

cfilter_count = 0;
ASSERT_OK(db_->CompactRange(CompactRangeOptions(), nullptr, nullptr));
Expand Down

0 comments on commit 34cedaf

Please sign in to comment.