Skip to content

Commit

Permalink
Remove all warning suppressions
Browse files Browse the repository at this point in the history
  • Loading branch information
vitaut committed Jul 22, 2024
1 parent 7f157dc commit 9fcd9c4
Showing 1 changed file with 2 additions and 18 deletions.
20 changes: 2 additions & 18 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 9fcd9c4

Please sign in to comment.