Skip to content

Commit

Permalink
Disable array-bounds checking without assertions to avoid false posit…
Browse files Browse the repository at this point in the history
…ives detected when compiling with GCC
  • Loading branch information
faluco committed Jun 17, 2024
1 parent 0dd6428 commit 480e334
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ if (ENABLE_WERROR)
if (HAS_STRINGOP_OVERFLOW)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=stringop-overflow")
endif()
if (ASSERT_LEVEL STREQUAL "MINIMAL")
check_cxx_compiler_flag("-Warray-bounds" HAS_ARRAY_BOUNDS)
if (HAS_ARRAY_BOUNDS)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=array-bounds")
endif()
endif()
endif()
endif ()

Expand Down

0 comments on commit 480e334

Please sign in to comment.