Skip to content

Commit

Permalink
disable more warnings for msvc
Browse files Browse the repository at this point in the history
  • Loading branch information
yamt committed Aug 12, 2024
1 parent 3579757 commit 1f580f7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cmake/ToywasmConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -303,12 +303,16 @@ if(CMAKE_C_COMPILER_ID MATCHES "Clang" OR CMAKE_C_COMPILER_ID STREQUAL GNU)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wvla -Werror")
endif()
if(CMAKE_C_COMPILER_ID STREQUAL "MSVC")
# C4018: '>': signed/unsigned mismatch
# C4061: enumerator 'TYPE_ANYREF' in switch of enum 'valtype' is not explicitly handled by a case label
# C4100: unreferenced formal parameter
# C4127: conditional expression is constant
# C4189: local variable is initialized but not referenced
# C4244: '=': conversion from 'float' to 'uint32_t', possible loss of data
# C4245: '=': conversion from 'int' to 'uint32_t', signed/unsigned mismatch
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Wall /WX /wd4100 /wd4127 /wd4189 /wd4244 /wd4245")
# C4296: '>': expression is always false
# C4820: 'exec_context': '7' bytes padding added after data member 'fast'
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Wall /WX /wd4018 /wd4061 /wd4100 /wd4127 /wd4189 /wd4244 /wd4245 /wd4296 /wd4820")
endif()
if(CMAKE_C_COMPILER_ID STREQUAL GNU)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unknown-pragmas")
Expand Down

0 comments on commit 1f580f7

Please sign in to comment.