Remove all warning suppressions

This commit is contained in:
Victor Zverovich 2024-07-22 12:41:12 -07:00
parent 7f157dca0a
commit 9fcd9c4c12

View File

@ -8,22 +8,6 @@ target_include_directories(test-main PUBLIC
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>)
target_link_libraries(test-main gtest fmt)
function(add_fmt_executable name)
add_executable(${name} ${ARGN})
# (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_compile_options(${name} PRIVATE -Wno-stringop-overflow)
# The linker flag is needed for LTO.
target_link_libraries(${name} -Wno-stringop-overflow)
endif ()
endfunction()
# Adds a test.
# Usage: add_fmt_test(name srcs...)
function(add_fmt_test name)
@ -42,7 +26,7 @@ function(add_fmt_test name)
else ()
set(libs test-main fmt)
endif ()
add_fmt_executable(${name} ${sources})
add_executable(${name} ${sources})
target_link_libraries(${name} ${libs})
if (ADD_FMT_TEST_HEADER_ONLY AND NOT FMT_UNICODE)
@ -145,7 +129,7 @@ if (NOT DEFINED MSVC_STATIC_RUNTIME AND MSVC)
endif()
if (NOT MSVC_STATIC_RUNTIME)
add_fmt_executable(posix-mock-test
add_executable(posix-mock-test
posix-mock-test.cc ../src/format.cc ${TEST_MAIN_SRC})
target_include_directories(
posix-mock-test PRIVATE ${PROJECT_SOURCE_DIR}/include)