From c7ee9c3ab72c8bd18832e07e1bb5cc3583754036 Mon Sep 17 00:00:00 2001 From: Igor Canadi Date: Mon, 10 Nov 2014 17:39:38 -0500 Subject: [PATCH] Fix -Wnon-virtual-dtor errors Summary: This breaks mongo+rocks build https://mci.10gen.com/task_log_raw/rocksdb_ubuntu1404_rocksdb_c6e8e3d868660dc66b3bbd438cdc135df6356c5a_14_11_10_21_36_10_compile_ubuntu1404_rocksdb/0?type=T Test Plan: m check + -Wnon-virtual-dtor Reviewers: sdong Reviewed By: sdong Subscribers: dhruba, leveldb Differential Revision: https://reviews.facebook.net/D28653 --- Makefile | 2 +- db/wal_manager.h | 4 ++-- include/rocksdb/listener.h | 1 + util/arena.h | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index b8913108f..ff8dcd3c3 100644 --- a/Makefile +++ b/Makefile @@ -69,7 +69,7 @@ install: @[ ! -e $(SHARED) ] || install -C -m 644 $(SHARED) $(INSTALL_PATH)/lib #------------------------------------------------- -WARNING_FLAGS = -Wall -Werror -Wsign-compare -Wshadow +WARNING_FLAGS = -Wall -Werror -Wsign-compare -Wshadow -Wnon-virtual-dtor CFLAGS += $(WARNING_FLAGS) -I. -I./include $(PLATFORM_CCFLAGS) $(OPT) CXXFLAGS += $(WARNING_FLAGS) -I. -I./include $(PLATFORM_CXXFLAGS) $(OPT) -Woverloaded-virtual diff --git a/db/wal_manager.h b/db/wal_manager.h index 493c426e3..fc04863b2 100644 --- a/db/wal_manager.h +++ b/db/wal_manager.h @@ -38,9 +38,9 @@ class WalManager { env_(db_options.env), purge_wal_files_last_run_(0) {} - virtual Status GetSortedWalFiles(VectorLogPtr& files); + Status GetSortedWalFiles(VectorLogPtr& files); - virtual Status GetUpdatesSince( + Status GetUpdatesSince( SequenceNumber seq_number, std::unique_ptr* iter, const TransactionLogIterator::ReadOptions& read_options, VersionSet* version_set); diff --git a/include/rocksdb/listener.h b/include/rocksdb/listener.h index 33e5fc51f..4ad1ae04b 100644 --- a/include/rocksdb/listener.h +++ b/include/rocksdb/listener.h @@ -58,6 +58,7 @@ class EventListener { const std::string& file_path, bool triggered_writes_slowdown, bool triggered_writes_stop) {} + virtual ~EventListener() {} }; } // namespace rocksdb diff --git a/util/arena.h b/util/arena.h index 0855c205c..dfd8e2b24 100644 --- a/util/arena.h +++ b/util/arena.h @@ -69,7 +69,7 @@ class Arena { // If an allocation is too big, we'll allocate an irregular block with the // same size of that allocation. - virtual size_t IrregularBlockNum() const { return irregular_block_num; } + size_t IrregularBlockNum() const { return irregular_block_num; } size_t BlockSize() const { return kBlockSize; }