From b5bddfe4dbb28a080251d28ef39c8d3178e359c4 Mon Sep 17 00:00:00 2001 From: Daniele Sciascia Date: Tue, 20 Sep 2022 11:47:43 +0200 Subject: [PATCH] Fix warnings when -Wextra-semi is enabled Also, add argument -Wextra-semi if supported by the compiler. --- CMakeLists.txt | 4 ++++ dbsim/db_server.hpp | 2 +- dbsim/db_tls.hpp | 2 +- include/wsrep/provider_options.hpp | 2 +- include/wsrep/thread.hpp | 2 +- 5 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fad26cf..292c413 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -86,6 +86,10 @@ check_cxx_compiler_flag("-Wsuggest-override" HAVE_SUGGEST_OVERRIDE) if (HAVE_SUGGEST_OVERRIDE) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wsuggest-override") endif() +check_cxx_compiler_flag("-Wextra-semi" HAVE_EXTRA_SEMI) +if (HAVE_EXTRA_SEMI) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wextra-semi") +endif() if (WSREP_LIB_STRICT_BUILD_FLAGS) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Weffc++") diff --git a/dbsim/db_server.hpp b/dbsim/db_server.hpp index 9f197be..98b9a83 100644 --- a/dbsim/db_server.hpp +++ b/dbsim/db_server.hpp @@ -77,6 +77,6 @@ namespace db std::vector> clients_; std::vector client_threads_; }; -}; +} #endif // WSREP_DB_SERVER_HPP diff --git a/dbsim/db_tls.hpp b/dbsim/db_tls.hpp index 97c4387..02051dc 100644 --- a/dbsim/db_tls.hpp +++ b/dbsim/db_tls.hpp @@ -57,6 +57,6 @@ namespace db static void init(int mode); static std::string stats(); }; -}; +} #endif // WSREP_DB_TLS_HPP diff --git a/include/wsrep/provider_options.hpp b/include/wsrep/provider_options.hpp index 21d227b..bb14500 100644 --- a/include/wsrep/provider_options.hpp +++ b/include/wsrep/provider_options.hpp @@ -57,7 +57,7 @@ namespace wsrep class option_value { public: - virtual ~option_value(){} + virtual ~option_value() {} virtual const char* as_string() const = 0; virtual const void* get_ptr() const = 0; }; diff --git a/include/wsrep/thread.hpp b/include/wsrep/thread.hpp index 99b8cff..bdb193c 100644 --- a/include/wsrep/thread.hpp +++ b/include/wsrep/thread.hpp @@ -52,4 +52,4 @@ namespace wsrep } std::ostream& operator<<(std::ostream&, const thread::id&); -}; +}