Skip to content

Commit

Permalink
Set unsafe-buffer-usage to no-error
Browse files Browse the repository at this point in the history
  • Loading branch information
mikir committed Sep 30, 2024
1 parent 9b1c2f8 commit 02f1179
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions cmake/compiler_utils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@ function(compiler_get_warnings_setup VARNAME)
"-Wno-documentation-html"
"-Wno-documentation"
)
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "18.0.0")
set(WARNINGS_SETUP_LIST "${WARNINGS_SETUP_LIST}"
"-Wno-unsafe-buffer-usage"
)
endif ()
string(REPLACE ";" " " WARNINGS_SETUP "${WARNINGS_SETUP_LIST}")
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
set(WARNINGS_SETUP "/W3 /wd4800")
Expand Down Expand Up @@ -109,6 +104,10 @@ function(compiler_get_warnings_as_errors_setup VARNAME)
)
string(REPLACE ";" " " WARNINGS_SETUP "${WARNINGS_SETUP} ${WARNINGS_SETUP_LIST}")
endif ()
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "18.0.0")
set(WARNINGS_SETUP # need to refactor all pointer arithmetic to span/vector/array+index usage
"${WARNINGS_SETUP} -Wno-error=unsafe-buffer-usage")
endif ()
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
if (ZSERIO_ENABLE_WERROR)
set(WARNINGS_SETUP "/WX")
Expand Down

0 comments on commit 02f1179

Please sign in to comment.