Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable additional MSVC warnings #1124

Merged
merged 1 commit into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -162,17 +162,21 @@ if(MSVC)
set(MSVC_DISABLED_WARNINGS_LIST
"C4018" # 'expression' : signed/unsigned mismatch
"C4057" # 'operator' : 'identifier1' indirection to
# slightly different base types from 'identifier2'
# slightly different base types from 'identifier2'
"C4100" # 'identifier' : unreferenced formal parameter
"C4127" # conditional expression is constant
"C4132" # 'object' : const object should be initialized
botovq marked this conversation as resolved.
Show resolved Hide resolved
"C4146" # unary minus operator applied to unsigned type,
# result still unsigned
"C4206" # nonstandard extension used : translation unit is empty
botovq marked this conversation as resolved.
Show resolved Hide resolved
"C4244" # 'argument' : conversion from 'type1' to 'type2',
# possible loss of data
"C4245" # 'conversion' : conversion from 'type1' to 'type2',
# signed/unsigned mismatch
"C4267" # 'var' : conversion from 'size_t' to 'type',
# possible loss of data
"C4295" # 'array' : array is too small to include a terminating
# null character
botovq marked this conversation as resolved.
Show resolved Hide resolved
"C4389" # 'operator' : signed/unsigned mismatch
"C4706" # assignment within conditional expression
"C4996" # The POSIX name for this item is deprecated.
Expand Down
12 changes: 11 additions & 1 deletion crypto/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -814,6 +814,17 @@ elseif(HOST_X86_64)
target_include_directories(crypto_obj PRIVATE bn/arch/amd64)
endif()

if(MSVC)
# "C4701" - Potentially uninitialized local variable 'name' used
set_source_files_properties(bn/bn_convert.c pem/pem_lib.c PROPERTIES
COMPILE_OPTIONS /wd4701
)
# "C4702" - unreachable code
set_source_files_properties(pkcs7/pk7_doit.c PROPERTIES
COMPILE_OPTIONS /wd4702
)
endif()

add_library(crypto $<TARGET_OBJECTS:crypto_obj> $<TARGET_OBJECTS:compat_obj> empty.c)

export_symbol(crypto ${CMAKE_CURRENT_BINARY_DIR}/crypto_p.sym)
Expand Down Expand Up @@ -867,4 +878,3 @@ if(BUILD_SHARED_LIBS)
add_library(crypto-static STATIC $<TARGET_OBJECTS:crypto_obj>)
target_link_libraries(crypto-static ${PLATFORM_LIBS})
endif()

8 changes: 7 additions & 1 deletion ssl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,13 @@ target_include_directories(ssl_obj
../include
${CMAKE_BINARY_DIR}/include)

if(MSVC)
# "C4702" - unreachable code
set_source_files_properties(d1_pkt.c s3_cbc.c PROPERTIES
COMPILE_OPTIONS /wd4702
)
endif()

add_library(bs_obj OBJECT ${BS_SRC})
target_include_directories(bs_obj
PRIVATE
Expand Down Expand Up @@ -157,4 +164,3 @@ if(BUILD_SHARED_LIBS)
add_library(ssl-static STATIC $<TARGET_OBJECTS:ssl_obj>)
target_link_libraries(ssl-static crypto-static ${PLATFORM_LIBS})
endif()

Loading