Skip to content

Commit

Permalink
build: prevent gcc -Wstringop-overflow workaround from affecting clang
Browse files Browse the repository at this point in the history
We check for a gcc-specific bug, but because we inject warning flags,
the test fails on newer versions of clang (since it doesn't like the
warning flags). Due to the failure, we then inject the workaround for
clang builds, which again fails.

Fix that by only applying the workaround for gcc.

Closes #2055
  • Loading branch information
avikivity authored and xemul committed Jan 31, 2024
1 parent 39612fa commit 6d89909
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -797,11 +797,13 @@ set (Seastar_PRIVATE_CXX_FLAGS
-Wdeprecated
-Wno-error=deprecated)

include (CheckGcc107852)
if (NOT Cxx_Compiler_BZ107852_Free)
list (APPEND Seastar_PRIVATE_CXX_FLAGS
-Wno-error=stringop-overflow
-Wno-error=array-bounds)
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
include (CheckGcc107852)
if (NOT Cxx_Compiler_BZ107852_Free)
list (APPEND Seastar_PRIVATE_CXX_FLAGS
-Wno-error=stringop-overflow
-Wno-error=array-bounds)
endif()
endif ()

if (NOT BUILD_SHARED_LIBS)
Expand Down

0 comments on commit 6d89909

Please sign in to comment.