diff options
author | Theo Buehler <tb@openbsd.org> | 2024-11-13 23:44:41 +0100 |
---|---|---|
committer | Theo Buehler <tb@openbsd.org> | 2024-11-13 23:44:41 +0100 |
commit | b5beb0d5a747f8244c4df13c25382db55273e34c (patch) | |
tree | 557cef828aaf5e12b1cfbda091cf1ee9ca6d6b5a | |
parent | a59cc93264b67ebc786cf3985c55b640a7ab7fa4 (diff) | |
parent | 1996dbc07d129cf2b1d32be384a131b9e6fa5373 (diff) | |
download | portable-b5beb0d5a747f8244c4df13c25382db55273e34c.tar.gz portable-b5beb0d5a747f8244c4df13c25382db55273e34c.tar.bz2 portable-b5beb0d5a747f8244c4df13c25382db55273e34c.zip |
Land #1124 - silence some MSVC warnings
-rw-r--r-- | CMakeLists.txt | 6 | ||||
-rw-r--r-- | crypto/CMakeLists.txt | 12 | ||||
-rw-r--r-- | ssl/CMakeLists.txt | 8 |
3 files changed, 23 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 0173bf8..ebd8260 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
@@ -162,17 +162,21 @@ if(MSVC) | |||
162 | set(MSVC_DISABLED_WARNINGS_LIST | 162 | set(MSVC_DISABLED_WARNINGS_LIST |
163 | "C4018" # 'expression' : signed/unsigned mismatch | 163 | "C4018" # 'expression' : signed/unsigned mismatch |
164 | "C4057" # 'operator' : 'identifier1' indirection to | 164 | "C4057" # 'operator' : 'identifier1' indirection to |
165 | # slightly different base types from 'identifier2' | 165 | # slightly different base types from 'identifier2' |
166 | "C4100" # 'identifier' : unreferenced formal parameter | 166 | "C4100" # 'identifier' : unreferenced formal parameter |
167 | "C4127" # conditional expression is constant | 167 | "C4127" # conditional expression is constant |
168 | "C4132" # 'object' : const object should be initialized | ||
168 | "C4146" # unary minus operator applied to unsigned type, | 169 | "C4146" # unary minus operator applied to unsigned type, |
169 | # result still unsigned | 170 | # result still unsigned |
171 | "C4206" # nonstandard extension used : translation unit is empty | ||
170 | "C4244" # 'argument' : conversion from 'type1' to 'type2', | 172 | "C4244" # 'argument' : conversion from 'type1' to 'type2', |
171 | # possible loss of data | 173 | # possible loss of data |
172 | "C4245" # 'conversion' : conversion from 'type1' to 'type2', | 174 | "C4245" # 'conversion' : conversion from 'type1' to 'type2', |
173 | # signed/unsigned mismatch | 175 | # signed/unsigned mismatch |
174 | "C4267" # 'var' : conversion from 'size_t' to 'type', | 176 | "C4267" # 'var' : conversion from 'size_t' to 'type', |
175 | # possible loss of data | 177 | # possible loss of data |
178 | "C4295" # 'array' : array is too small to include a terminating | ||
179 | # null character | ||
176 | "C4389" # 'operator' : signed/unsigned mismatch | 180 | "C4389" # 'operator' : signed/unsigned mismatch |
177 | "C4706" # assignment within conditional expression | 181 | "C4706" # assignment within conditional expression |
178 | "C4996" # The POSIX name for this item is deprecated. | 182 | "C4996" # The POSIX name for this item is deprecated. |
diff --git a/crypto/CMakeLists.txt b/crypto/CMakeLists.txt index acb5a71..6c26528 100644 --- a/crypto/CMakeLists.txt +++ b/crypto/CMakeLists.txt | |||
@@ -814,6 +814,17 @@ elseif(HOST_X86_64) | |||
814 | target_include_directories(crypto_obj PRIVATE bn/arch/amd64) | 814 | target_include_directories(crypto_obj PRIVATE bn/arch/amd64) |
815 | endif() | 815 | endif() |
816 | 816 | ||
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 | |||
817 | add_library(crypto $<TARGET_OBJECTS:crypto_obj> $<TARGET_OBJECTS:compat_obj> empty.c) | 828 | add_library(crypto $<TARGET_OBJECTS:crypto_obj> $<TARGET_OBJECTS:compat_obj> empty.c) |
818 | 829 | ||
819 | export_symbol(crypto ${CMAKE_CURRENT_BINARY_DIR}/crypto_p.sym) | 830 | export_symbol(crypto ${CMAKE_CURRENT_BINARY_DIR}/crypto_p.sym) |
@@ -867,4 +878,3 @@ if(BUILD_SHARED_LIBS) | |||
867 | add_library(crypto-static STATIC $<TARGET_OBJECTS:crypto_obj>) | 878 | add_library(crypto-static STATIC $<TARGET_OBJECTS:crypto_obj>) |
868 | target_link_libraries(crypto-static ${PLATFORM_LIBS}) | 879 | target_link_libraries(crypto-static ${PLATFORM_LIBS}) |
869 | endif() | 880 | endif() |
870 | |||
diff --git a/ssl/CMakeLists.txt b/ssl/CMakeLists.txt index cf62ff4..bdcfbb2 100644 --- a/ssl/CMakeLists.txt +++ b/ssl/CMakeLists.txt | |||
@@ -72,6 +72,13 @@ target_include_directories(ssl_obj | |||
72 | ../include | 72 | ../include |
73 | ${CMAKE_BINARY_DIR}/include) | 73 | ${CMAKE_BINARY_DIR}/include) |
74 | 74 | ||
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 | |||
75 | add_library(bs_obj OBJECT ${BS_SRC}) | 82 | add_library(bs_obj OBJECT ${BS_SRC}) |
76 | target_include_directories(bs_obj | 83 | target_include_directories(bs_obj |
77 | PRIVATE | 84 | PRIVATE |
@@ -157,4 +164,3 @@ if(BUILD_SHARED_LIBS) | |||
157 | add_library(ssl-static STATIC $<TARGET_OBJECTS:ssl_obj>) | 164 | add_library(ssl-static STATIC $<TARGET_OBJECTS:ssl_obj>) |
158 | target_link_libraries(ssl-static crypto-static ${PLATFORM_LIBS}) | 165 | target_link_libraries(ssl-static crypto-static ${PLATFORM_LIBS}) |
159 | endif() | 166 | endif() |
160 | |||