diff --git a/Makefile b/Makefile index 396b8e201..a6d3cae4d 100644 --- a/Makefile +++ b/Makefile @@ -192,7 +192,7 @@ ifndef DISABLE_WARNING_AS_ERROR endif CFLAGS += $(WARNING_FLAGS) -I. -I./include $(PLATFORM_CCFLAGS) $(OPT) -CXXFLAGS += $(WARNING_FLAGS) -I. -I./include $(PLATFORM_CXXFLAGS) $(OPT) -Woverloaded-virtual -Wnon-virtual-dtor -Wno-missing-field-initializers +CXXFLAGS += $(WARNING_FLAGS) -I. -I./include $(PLATFORM_CXXFLAGS) $(OPT) -Woverloaded-virtual -Wnon-virtual-dtor -Werror=missing-field-initializers LDFLAGS += $(PLATFORM_LDFLAGS) diff --git a/db/column_family_test.cc b/db/column_family_test.cc index ba048e64e..70035a939 100644 --- a/db/column_family_test.cc +++ b/db/column_family_test.cc @@ -1990,10 +1990,10 @@ TEST_F(ColumnFamilyTest, FlushAndDropRaceCondition) { Reopen({options, options}); rocksdb::SyncPoint::GetInstance()->LoadDependency( - {{"VersionSet::LogAndApply::ColumnFamilyDrop:1" + {{"VersionSet::LogAndApply::ColumnFamilyDrop:1", "FlushJob::InstallResults"}, {"FlushJob::InstallResults", - "VersionSet::LogAndApply::ColumnFamilyDrop:2", }}); + "VersionSet::LogAndApply::ColumnFamilyDrop:2"}}); rocksdb::SyncPoint::GetInstance()->EnableProcessing(); test::SleepingBackgroundTask sleeping_task; diff --git a/db/db_impl.cc b/db/db_impl.cc index dd6519fba..661e3b48a 100644 --- a/db/db_impl.cc +++ b/db/db_impl.cc @@ -4383,7 +4383,7 @@ Status DBImpl::WriteImpl(const WriteOptions& write_options, &flush_scheduler_, write_options.ignore_missing_column_families, 0 /*log_number*/, this, false /*dont_filter_deletes*/); } else { - WriteThread::ParallelGroup pg{}; + WriteThread::ParallelGroup pg; pg.leader = &w; pg.last_writer = last_writer; pg.early_exit_allowed = !need_log_sync; diff --git a/db/db_test.cc b/db/db_test.cc index 8d37d1c44..ff983c36c 100644 --- a/db/db_test.cc +++ b/db/db_test.cc @@ -5653,7 +5653,7 @@ TEST_F(DBTest, GroupCommitTest) { ASSERT_TRUE(!itr->Valid()); delete itr; - HistogramData hist_data = {0}; + HistogramData hist_data = {0, 0, 0, 0, 0}; options.statistics->histogramData(DB_WRITE, &hist_data); ASSERT_GT(hist_data.average, 0.0); } while (ChangeOptions(kSkipNoSeekToLast)); diff --git a/db/write_thread.cc b/db/write_thread.cc index 5e43937ee..e153f319b 100644 --- a/db/write_thread.cc +++ b/db/write_thread.cc @@ -213,7 +213,7 @@ void WriteThread::CreateMissingNewerLinks(Writer* head) { } void WriteThread::JoinBatchGroup(Writer* w) { - static AdaptationContext ctx{"JoinBatchGroup"}; + static AdaptationContext ctx("JoinBatchGroup"); assert(w->batch != nullptr); bool linked_as_leader; @@ -323,7 +323,7 @@ void WriteThread::LaunchParallelFollowers(ParallelGroup* pg, } bool WriteThread::CompleteParallelWorker(Writer* w) { - static AdaptationContext ctx{"CompleteParallelWorker"}; + static AdaptationContext ctx("CompleteParallelWorker"); auto* pg = w->parallel_group; if (!w->status.ok()) { @@ -419,7 +419,7 @@ void WriteThread::ExitAsBatchGroupLeader(Writer* leader, Writer* last_writer, } void WriteThread::EnterUnbatched(Writer* w, InstrumentedMutex* mu) { - static AdaptationContext ctx{"EnterUnbatched"}; + static AdaptationContext ctx("EnterUnbatched"); assert(w->batch == nullptr); bool linked_as_leader; diff --git a/db/write_thread.h b/db/write_thread.h index 2fdd4a02f..e31904ed1 100644 --- a/db/write_thread.h +++ b/db/write_thread.h @@ -207,6 +207,8 @@ class WriteThread { struct AdaptationContext { const char* name; std::atomic value; + + explicit AdaptationContext(const char* name0) : name(name0), value(0) {} }; private: diff --git a/table/table_test.cc b/table/table_test.cc index cf58a2477..eb2b52ef9 100644 --- a/table/table_test.cc +++ b/table/table_test.cc @@ -1998,7 +1998,7 @@ TEST_F(HarnessTest, Randomized) { #ifndef ROCKSDB_LITE TEST_F(HarnessTest, RandomizedLongDB) { Random rnd(test::RandomSeed()); - TestArgs args = { DB_TEST, false, 16, kNoCompression, 0 }; + TestArgs args = {DB_TEST, false, 16, kNoCompression, 0, false}; Init(args); int num_entries = 100000; for (int e = 0; e < num_entries; e++) {