From 46d11871725fe5b7740572aa523bd57c81914dff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Tue, 15 May 2018 19:43:32 +0300 Subject: [PATCH] Backport GCC 8 fixes to 2.1 Backported the minimal set of changes required to build 2.1 with GCC 8. The format-truncation and format-overflow warnings are disabled instead of fixed in 2.1 to remove duplication of effort that was already done in 2.2 (the commit doesn't cherry-pick cleanly). --- server/core/gateway.cc | 2 +- server/core/maxpasswd.c | 1 + server/modules/routing/avrorouter/CMakeLists.txt | 1 + server/modules/routing/binlogrouter/CMakeLists.txt | 2 ++ 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/server/core/gateway.cc b/server/core/gateway.cc index 169595442..3a70bc1c8 100644 --- a/server/core/gateway.cc +++ b/server/core/gateway.cc @@ -39,12 +39,12 @@ #include #include -#include #include #include #include #include #include +#include #include #include diff --git a/server/core/maxpasswd.c b/server/core/maxpasswd.c index fcb1bf4e4..b18e58c62 100644 --- a/server/core/maxpasswd.c +++ b/server/core/maxpasswd.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include diff --git a/server/modules/routing/avrorouter/CMakeLists.txt b/server/modules/routing/avrorouter/CMakeLists.txt index 0fe35de54..39c1c6b11 100644 --- a/server/modules/routing/avrorouter/CMakeLists.txt +++ b/server/modules/routing/avrorouter/CMakeLists.txt @@ -6,6 +6,7 @@ if(AVRO_FOUND AND JANSSON_FOUND) set_target_properties(avrorouter PROPERTIES LINK_FLAGS -Wl,-z,defs) target_link_libraries(avrorouter maxscale-common ${JANSSON_LIBRARIES} ${AVRO_LIBRARIES} maxavro sqlite3 lzma) install_module(avrorouter core) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-format-overflow -Wno-format-truncation") if (BUILD_TESTS) add_subdirectory(test) diff --git a/server/modules/routing/binlogrouter/CMakeLists.txt b/server/modules/routing/binlogrouter/CMakeLists.txt index a847e9792..99b14e735 100644 --- a/server/modules/routing/binlogrouter/CMakeLists.txt +++ b/server/modules/routing/binlogrouter/CMakeLists.txt @@ -9,6 +9,8 @@ target_link_libraries(maxbinlogcheck maxscale-common ${PCRE_LINK_FLAGS} uuid) install_executable(maxbinlogcheck core) +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-format-overflow -Wno-format-truncation") + if(BUILD_TESTS) add_subdirectory(test) endif()