From 07211701f475b1148a7634afa8d6dacb1feff4ee Mon Sep 17 00:00:00 2001 From: Vladislav Shchapov Date: Tue, 3 Aug 2021 02:20:18 +0500 Subject: [PATCH] Disable the -Wstringop-overflow warning from GCC 7 (#2442) --- test/CMakeLists.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 0e8c59e2..bf3785a6 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -26,6 +26,16 @@ function(add_fmt_executable name) if (MINGW) target_link_libraries(${name} -static-libgcc -static-libstdc++) endif () + # (Wstringop-overflow) - [meta-bug] bogus/missing -Wstringop-overflow warnings + # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88443 + # Bogus -Wstringop-overflow warning + # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100395 + # [10 Regression] spurious -Wstringop-overflow writing to a trailing array plus offset + # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95353 + if (CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND + NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0) + target_link_libraries(${name} -Wno-stringop-overflow) + endif () endfunction() # Adds a test.