Skip to content

Commit

Permalink
Define -Wno-unsafe-buffer-usage for clang-17+
Browse files Browse the repository at this point in the history
  • Loading branch information
syoyo committed Sep 28, 2023
1 parent e7fbaaa commit c75ed6b
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -972,14 +972,11 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
"-Weverything -Werror -Wno-poison-system-directories -Wno-padded -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-documentation -Wno-unused-member-function"
)

if(EMSCRIPTEN)
# Recent `latest` emscripten(as of 2023 May 5. clang17)
# seems enable -Wunsafe-buffer-usage when `-Weverything` is defined,
# resulting compilation error for some raw array access without bound check.
#
# https://reviews.llvm.org/D138940
#
# we need to suppress it as a work around.
# clang17 seems enable -Wunsafe-buffer-usage when `-Weverything` is defined,
# resulting compilation error for some raw array access without bound check.
# https://reviews.llvm.org/D138940
# we need to suppress it as a work around.
if (${CMAKE_CXX_COMPILER_VERSION} VERSION_GREATER 16)
set(TUSDZ_COMPILE_FLAGS "${TUSDZ_COMPILE_FLAGS} -Wno-unsafe-buffer-usage")
endif()

Expand Down

0 comments on commit c75ed6b

Please sign in to comment.