[geode-native] branch develop updated: GEODE-8469: Enable no-missing-variable-declarations (#645)
This is an automated email from the ASF dual-hosted git repository. moleske pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/geode-native.git The following commit(s) were added to refs/heads/develop by this push: new 4617f22 GEODE-8469: Enable no-missing-variable-declarations (#645) 4617f22 is described below commit 4617f22a1fa91464e8f9a38b08eeff206c1677d4 Author: M. Oleske AuthorDate: Mon Sep 28 17:56:29 2020 -0700 GEODE-8469: Enable no-missing-variable-declarations (#645) * Enable no-missing-variable-declarations * ignore the warning in integration-test. We don't care about the old test code. Authored-by: M. Oleske Co-authored-by: Blake Bender Co-authored-by: Blake Bender --- CMakeLists.txt | 1 - cppcache/benchmark/GeodeLoggingBM.cpp | 28 ++-- cppcache/integration-test/CMakeLists.txt | 6 + cppcache/src/DataOutput.cpp| 3 +- cppcache/src/Exception.cpp | 2 +- cppcache/src/ExceptionTypes.cpp| 169 ++--- cppcache/src/Log.cpp | 28 ++-- cppcache/src/PdxFieldType.cpp | 4 +- cppcache/test/CacheXmlParserTest.cpp | 10 +- tests/cpp/security/XmlAuthzCredentialGenerator.hpp | 18 +-- 10 files changed, 135 insertions(+), 134 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5842f61..e71dd1b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -255,7 +255,6 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") -Wno-float-equal #TODO fix -Wno-header-hygiene #TODO fix -Wno-conversion #TODO fix --Wno-missing-variable-declarations #TODO fix -Wno-reserved-id-macro #TODO fix -Wno-documentation # TODO fix -Wno-range-loop-analysis diff --git a/cppcache/benchmark/GeodeLoggingBM.cpp b/cppcache/benchmark/GeodeLoggingBM.cpp index ac49e31..3dd3ff7 100644 --- a/cppcache/benchmark/GeodeLoggingBM.cpp +++ b/cppcache/benchmark/GeodeLoggingBM.cpp @@ -35,9 +35,9 @@ using apache::geode::client::internal::geode_hash; const int STRING_ARRAY_LENGTH = 3; -int g_iteration = 0; +static int g_iteration = 0; -std::array logStrings{ +static std::array logStrings{ "Short test string", "Slightly longer test string", "Very long string: " "AA" @@ -106,17 +106,17 @@ void GeodeLogToFile(benchmark::State& state) { } } -auto LogStringsToConsole = GeodeLogToConsole; -auto LogIntsToConsole = GeodeLogToConsole; -auto LogComboToConsole = GeodeLogToConsole; +static const auto kLogStringsToConsole = GeodeLogToConsole; +static const auto kLogIntsToConsole = GeodeLogToConsole; +static const auto kLogComboToConsole = GeodeLogToConsole; -auto LogStringsToFile = GeodeLogToFile; -auto LogIntsToFile = GeodeLogToFile; -auto LogComboToFile = GeodeLogToFile; +static const auto kLogStringsToFile = GeodeLogToFile; +static const auto kLogIntsToFile = GeodeLogToFile; +static const auto kLogComboToFile = GeodeLogToFile; -BENCHMARK(LogStringsToConsole)->Range(8, 8 << 10); -BENCHMARK(LogIntsToConsole)->Range(8, 8 << 10); -BENCHMARK(LogComboToConsole)->Range(8, 8 << 10); -BENCHMARK(LogStringsToFile)->Range(8, 8 << 10); -BENCHMARK(LogIntsToFile)->Range(8, 8 << 10); -BENCHMARK(LogComboToFile)->Range(8, 8 << 10); +BENCHMARK(kLogStringsToConsole)->Range(8, 8 << 10); +BENCHMARK(kLogIntsToConsole)->Range(8, 8 << 10); +BENCHMARK(kLogComboToConsole)->Range(8, 8 << 10); +BENCHMARK(kLogStringsToFile)->Range(8, 8 << 10); +BENCHMARK(kLogIntsToFile)->Range(8, 8 << 10); +BENCHMARK(kLogComboToFile)->Range(8, 8 << 10); diff --git a/cppcache/integration-test/CMakeLists.txt b/cppcache/integration-test/CMakeLists.txt index 6dd225e..fb5170a 100644 --- a/cppcache/integration-test/CMakeLists.txt +++ b/cppcache/integration-test/CMakeLists.txt @@ -105,6 +105,12 @@ foreach(FILE ${SOURCES}) FOLDER cpp/test/integration/legacy ) +if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") + target_compile_options(_WarningsAsError INTERFACE + -Wno-missing-variable-declarations + ) +endif() + target_link_libraries(${TEST} PRIVATE ACE::ACE diff --git a/cppcache/src/DataOutput.cpp b/cppcache/src/DataOutput.cpp index 12afb19..6b234ce 100644 --- a/cppcache/src/DataOutput.cpp +++ b/cppcache/src/DataOutput.cpp @@ -18,7 +18,6 @@ #include #include -#include #include "CacheImpl.hpp" #include "CacheRegionHelper.hpp" @@ -31,7 +30,7 @@ namespace apache { namespace geode { namespace client { -std::recursive_mutex globalBigBufferMutex; +static std::recursive_mutex globalBigBufferMutex; size_t DataOutput::m_highWaterMark = 50 * 1024 * 1024; size_t DataOutput::m_lowWaterMark = 8192; diff --git a/cppcache/src/Exception.cpp b/cppcache/src/Exception.cpp index 78e68c4..33a2837 100644 --- a/cppcache/src/Exception.cpp +++ b/cppca
[geode-native] branch develop updated: GEODE-8469: Enable no-missing-variable-declarations (#645)
This is an automated email from the ASF dual-hosted git repository. moleske pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/geode-native.git The following commit(s) were added to refs/heads/develop by this push: new 4617f22 GEODE-8469: Enable no-missing-variable-declarations (#645) 4617f22 is described below commit 4617f22a1fa91464e8f9a38b08eeff206c1677d4 Author: M. Oleske AuthorDate: Mon Sep 28 17:56:29 2020 -0700 GEODE-8469: Enable no-missing-variable-declarations (#645) * Enable no-missing-variable-declarations * ignore the warning in integration-test. We don't care about the old test code. Authored-by: M. Oleske Co-authored-by: Blake Bender Co-authored-by: Blake Bender --- CMakeLists.txt | 1 - cppcache/benchmark/GeodeLoggingBM.cpp | 28 ++-- cppcache/integration-test/CMakeLists.txt | 6 + cppcache/src/DataOutput.cpp| 3 +- cppcache/src/Exception.cpp | 2 +- cppcache/src/ExceptionTypes.cpp| 169 ++--- cppcache/src/Log.cpp | 28 ++-- cppcache/src/PdxFieldType.cpp | 4 +- cppcache/test/CacheXmlParserTest.cpp | 10 +- tests/cpp/security/XmlAuthzCredentialGenerator.hpp | 18 +-- 10 files changed, 135 insertions(+), 134 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5842f61..e71dd1b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -255,7 +255,6 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") -Wno-float-equal #TODO fix -Wno-header-hygiene #TODO fix -Wno-conversion #TODO fix --Wno-missing-variable-declarations #TODO fix -Wno-reserved-id-macro #TODO fix -Wno-documentation # TODO fix -Wno-range-loop-analysis diff --git a/cppcache/benchmark/GeodeLoggingBM.cpp b/cppcache/benchmark/GeodeLoggingBM.cpp index ac49e31..3dd3ff7 100644 --- a/cppcache/benchmark/GeodeLoggingBM.cpp +++ b/cppcache/benchmark/GeodeLoggingBM.cpp @@ -35,9 +35,9 @@ using apache::geode::client::internal::geode_hash; const int STRING_ARRAY_LENGTH = 3; -int g_iteration = 0; +static int g_iteration = 0; -std::array logStrings{ +static std::array logStrings{ "Short test string", "Slightly longer test string", "Very long string: " "AA" @@ -106,17 +106,17 @@ void GeodeLogToFile(benchmark::State& state) { } } -auto LogStringsToConsole = GeodeLogToConsole; -auto LogIntsToConsole = GeodeLogToConsole; -auto LogComboToConsole = GeodeLogToConsole; +static const auto kLogStringsToConsole = GeodeLogToConsole; +static const auto kLogIntsToConsole = GeodeLogToConsole; +static const auto kLogComboToConsole = GeodeLogToConsole; -auto LogStringsToFile = GeodeLogToFile; -auto LogIntsToFile = GeodeLogToFile; -auto LogComboToFile = GeodeLogToFile; +static const auto kLogStringsToFile = GeodeLogToFile; +static const auto kLogIntsToFile = GeodeLogToFile; +static const auto kLogComboToFile = GeodeLogToFile; -BENCHMARK(LogStringsToConsole)->Range(8, 8 << 10); -BENCHMARK(LogIntsToConsole)->Range(8, 8 << 10); -BENCHMARK(LogComboToConsole)->Range(8, 8 << 10); -BENCHMARK(LogStringsToFile)->Range(8, 8 << 10); -BENCHMARK(LogIntsToFile)->Range(8, 8 << 10); -BENCHMARK(LogComboToFile)->Range(8, 8 << 10); +BENCHMARK(kLogStringsToConsole)->Range(8, 8 << 10); +BENCHMARK(kLogIntsToConsole)->Range(8, 8 << 10); +BENCHMARK(kLogComboToConsole)->Range(8, 8 << 10); +BENCHMARK(kLogStringsToFile)->Range(8, 8 << 10); +BENCHMARK(kLogIntsToFile)->Range(8, 8 << 10); +BENCHMARK(kLogComboToFile)->Range(8, 8 << 10); diff --git a/cppcache/integration-test/CMakeLists.txt b/cppcache/integration-test/CMakeLists.txt index 6dd225e..fb5170a 100644 --- a/cppcache/integration-test/CMakeLists.txt +++ b/cppcache/integration-test/CMakeLists.txt @@ -105,6 +105,12 @@ foreach(FILE ${SOURCES}) FOLDER cpp/test/integration/legacy ) +if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") + target_compile_options(_WarningsAsError INTERFACE + -Wno-missing-variable-declarations + ) +endif() + target_link_libraries(${TEST} PRIVATE ACE::ACE diff --git a/cppcache/src/DataOutput.cpp b/cppcache/src/DataOutput.cpp index 12afb19..6b234ce 100644 --- a/cppcache/src/DataOutput.cpp +++ b/cppcache/src/DataOutput.cpp @@ -18,7 +18,6 @@ #include #include -#include #include "CacheImpl.hpp" #include "CacheRegionHelper.hpp" @@ -31,7 +30,7 @@ namespace apache { namespace geode { namespace client { -std::recursive_mutex globalBigBufferMutex; +static std::recursive_mutex globalBigBufferMutex; size_t DataOutput::m_highWaterMark = 50 * 1024 * 1024; size_t DataOutput::m_lowWaterMark = 8192; diff --git a/cppcache/src/Exception.cpp b/cppcache/src/Exception.cpp index 78e68c4..33a2837 100644 --- a/cppcache/src/Exception.cpp +++ b/cppca