From 8325326e19963218b43db15997d41c546c3ccd04 Mon Sep 17 00:00:00 2001 From: Roman Siromakha Date: Mon, 18 Jan 2021 23:58:10 +0100 Subject: [PATCH 1/2] Avoid gcc errors about not implemented string literal operator templates --- benchmarks/CMakeLists.txt | 4 ++-- examples/CMakeLists.txt | 10 +++++----- tests/CMakeLists.txt | 2 +- tests/external_project/CMakeLists.txt | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/benchmarks/CMakeLists.txt b/benchmarks/CMakeLists.txt index adbd2ff54..f1a35a1e7 100644 --- a/benchmarks/CMakeLists.txt +++ b/benchmarks/CMakeLists.txt @@ -24,7 +24,7 @@ ExternalProject_Add( include_directories(SYSTEM ${CMAKE_CURRENT_BINARY_DIR}/include) # enable a bunch of warnings and make them errors -target_compile_options(ozo_benchmark PRIVATE -Wall -Wextra -Wsign-compare -pedantic -Werror) +target_compile_options(ozo_benchmark PRIVATE -Wall -Wextra -Wsign-compare -Werror) # ignore specific error for clang if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") @@ -37,7 +37,7 @@ target_link_libraries(ozo_benchmark_performance ozo) target_link_libraries(ozo_benchmark_performance Boost::program_options) # enable a bunch of warnings and make them errors -target_compile_options(ozo_benchmark_performance PRIVATE -Wall -Wextra -Wsign-compare -pedantic -Werror) +target_compile_options(ozo_benchmark_performance PRIVATE -Wall -Wextra -Wsign-compare -Werror) # ignore specific error for clang if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index cd1acd349..46d6c1830 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -9,7 +9,7 @@ add_executable(ozo_request request.cpp) target_link_libraries(ozo_request ozo) # enable a bunch of warnings and make them errors -target_compile_options(ozo_request PRIVATE -Wall -Wextra -Wsign-compare -pedantic -Werror) +target_compile_options(ozo_request PRIVATE -Wall -Wextra -Wsign-compare -Werror) # ignore specific errors for clang if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") @@ -20,7 +20,7 @@ add_executable(ozo_transaction transaction.cpp) target_link_libraries(ozo_transaction ozo) # enable a bunch of warnings and make them errors -target_compile_options(ozo_transaction PRIVATE -Wall -Wextra -Wsign-compare -pedantic -Werror) +target_compile_options(ozo_transaction PRIVATE -Wall -Wextra -Wsign-compare -Werror) # ignore specific errors for clang if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") @@ -31,7 +31,7 @@ add_executable(ozo_retry_request retry_request.cpp) target_link_libraries(ozo_retry_request ozo) # enable a bunch of warnings and make them errors -target_compile_options(ozo_retry_request PRIVATE -Wall -Wextra -Wsign-compare -pedantic -Werror) +target_compile_options(ozo_retry_request PRIVATE -Wall -Wextra -Wsign-compare -Werror) # ignore specific errors for clang if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") @@ -42,7 +42,7 @@ add_executable(ozo_role_based_request role_based_request.cpp) target_link_libraries(ozo_role_based_request ozo) # enable a bunch of warnings and make them errors -target_compile_options(ozo_role_based_request PRIVATE -Wall -Wextra -Wsign-compare -pedantic -Werror) +target_compile_options(ozo_role_based_request PRIVATE -Wall -Wextra -Wsign-compare -Werror) # ignore specific errors for clang if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") @@ -53,7 +53,7 @@ add_executable(ozo_connection_pool connection_pool.cpp) target_link_libraries(ozo_connection_pool ozo) # enable a bunch of warnings and make them errors -target_compile_options(ozo_connection_pool PRIVATE -Wall -Wextra -Wsign-compare -pedantic -Werror) +target_compile_options(ozo_connection_pool PRIVATE -Wall -Wextra -Wsign-compare -Werror) # ignore specific errors for clang if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 170916bb3..31e280d5a 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -88,7 +88,7 @@ if(CCACHE_FOUND) endif() # enable useful warnings and errors -target_compile_options(ozo_tests PRIVATE -Wall -Wextra -pedantic -Werror) +target_compile_options(ozo_tests PRIVATE -Wall -Wextra -Werror) # ignore specific errors for clang if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") diff --git a/tests/external_project/CMakeLists.txt b/tests/external_project/CMakeLists.txt index 04c263d98..ab75e27c1 100644 --- a/tests/external_project/CMakeLists.txt +++ b/tests/external_project/CMakeLists.txt @@ -3,5 +3,5 @@ project(my_ozo_using_project) find_package(ozo REQUIRED) add_executable(my_app ../../examples/request.cpp warning_option_propagation.cpp) -target_compile_options(my_app PRIVATE -Wall -Wextra -pedantic -Werror) +target_compile_options(my_app PRIVATE -Wall -Wextra -Werror) target_link_libraries(my_app PRIVATE yandex::ozo) From 4aba8955210e1e5c0e6951c77c7259bd100f9b8a Mon Sep 17 00:00:00 2001 From: Roman Siromakha Date: Wed, 9 Jun 2021 21:25:50 +0200 Subject: [PATCH 2/2] Update googletest to fix gcc error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Described here: https://github.com/google/googletest/issues/3219 /home/elsid/dev/ozo/build/pg/gcc_debug/tests/GoogleTest-prefix/src/GoogleTest/googletest/src/gtest-death-test.cc: In function ‘bool testing::internal::StackGrowsDown()’: /home/elsid/dev/ozo/build/pg/gcc_debug/tests/GoogleTest-prefix/src/GoogleTest/googletest/src/gtest-death-test.cc:1301:24: error: ‘dummy’ may be used uninitialized [-Werror=maybe-uninitialized] 1301 | StackLowerThanAddress(&dummy, &result); | ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~ /home/elsid/dev/ozo/build/pg/gcc_debug/tests/GoogleTest-prefix/src/GoogleTest/googletest/src/gtest-death-test.cc:1290:13: note: by argument 1 of type ‘const void*’ to ‘void testing::internal::StackLowerThanAddress(const void*, bool*)’ declared here 1290 | static void StackLowerThanAddress(const void* ptr, bool* result) { | ^~~~~~~~~~~~~~~~~~~~~ /home/elsid/dev/ozo/build/pg/gcc_debug/tests/GoogleTest-prefix/src/GoogleTest/googletest/src/gtest-death-test.cc:1299:7: note: ‘dummy’ declared here 1299 | int dummy; | ^~~~~ --- tests/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 31e280d5a..9ce6bd315 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -4,7 +4,7 @@ include(ExternalProject) ExternalProject_Add( GoogleTest GIT_REPOSITORY "https://github.com/google/googletest.git" - GIT_TAG release-1.10.0 + GIT_TAG aa533abfd4232b01f9e57041d70114d5a77e6de0 CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_BINARY_DIR} UPDATE_COMMAND "" LOG_DOWNLOAD ON