Skip to content

Commit b5beb0d

Browse files
committed
Land #1124 - silence some MSVC warnings
2 parents a59cc93 + 1996dbc commit b5beb0d

File tree

3 files changed

+23
-3
lines changed

3 files changed

+23
-3
lines changed

CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,17 +162,21 @@ if(MSVC)
162162
set(MSVC_DISABLED_WARNINGS_LIST
163163
"C4018" # 'expression' : signed/unsigned mismatch
164164
"C4057" # 'operator' : 'identifier1' indirection to
165-
# slightly different base types from 'identifier2'
165+
# slightly different base types from 'identifier2'
166166
"C4100" # 'identifier' : unreferenced formal parameter
167167
"C4127" # conditional expression is constant
168+
"C4132" # 'object' : const object should be initialized
168169
"C4146" # unary minus operator applied to unsigned type,
169170
# result still unsigned
171+
"C4206" # nonstandard extension used : translation unit is empty
170172
"C4244" # 'argument' : conversion from 'type1' to 'type2',
171173
# possible loss of data
172174
"C4245" # 'conversion' : conversion from 'type1' to 'type2',
173175
# signed/unsigned mismatch
174176
"C4267" # 'var' : conversion from 'size_t' to 'type',
175177
# possible loss of data
178+
"C4295" # 'array' : array is too small to include a terminating
179+
# null character
176180
"C4389" # 'operator' : signed/unsigned mismatch
177181
"C4706" # assignment within conditional expression
178182
"C4996" # The POSIX name for this item is deprecated.

crypto/CMakeLists.txt

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -814,6 +814,17 @@ elseif(HOST_X86_64)
814814
target_include_directories(crypto_obj PRIVATE bn/arch/amd64)
815815
endif()
816816

817+
if(MSVC)
818+
# "C4701" - Potentially uninitialized local variable 'name' used
819+
set_source_files_properties(bn/bn_convert.c pem/pem_lib.c PROPERTIES
820+
COMPILE_OPTIONS /wd4701
821+
)
822+
# "C4702" - unreachable code
823+
set_source_files_properties(pkcs7/pk7_doit.c PROPERTIES
824+
COMPILE_OPTIONS /wd4702
825+
)
826+
endif()
827+
817828
add_library(crypto $<TARGET_OBJECTS:crypto_obj> $<TARGET_OBJECTS:compat_obj> empty.c)
818829

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

ssl/CMakeLists.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,13 @@ target_include_directories(ssl_obj
7272
../include
7373
${CMAKE_BINARY_DIR}/include)
7474

75+
if(MSVC)
76+
# "C4702" - unreachable code
77+
set_source_files_properties(d1_pkt.c s3_cbc.c PROPERTIES
78+
COMPILE_OPTIONS /wd4702
79+
)
80+
endif()
81+
7582
add_library(bs_obj OBJECT ${BS_SRC})
7683
target_include_directories(bs_obj
7784
PRIVATE
@@ -157,4 +164,3 @@ if(BUILD_SHARED_LIBS)
157164
add_library(ssl-static STATIC $<TARGET_OBJECTS:ssl_obj>)
158165
target_link_libraries(ssl-static crypto-static ${PLATFORM_LIBS})
159166
endif()
160-

0 commit comments

Comments
 (0)