Skip to content

Commit

Permalink
Disable the -Wstringop-overflow warning from GCC 7 (fmtlib#2442)
Browse files Browse the repository at this point in the history
  • Loading branch information
phprus authored and PoetaKodu committed Nov 11, 2021
1 parent 8a457f0 commit e6d5530
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit e6d5530

Please sign in to comment.