Remove MSVC warning suppressions around Windows system headers
These seem to no longer be needed? Over time we have gotten a bit more
measured about enabling all of MSVC's warnings (MSVC is just not
designed to be used with -Wall), so I'm guessing that's what changed.
Change-Id: If71850136fb83841a423b63bdf65c2d546ba0223
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/77887
Auto-Submit: David Benjamin <davidben@google.com>
Reviewed-by: Bob Beck <bbe@google.com>
Commit-Queue: Bob Beck <bbe@google.com>
diff --git a/crypto/bio/bio_test.cc b/crypto/bio/bio_test.cc
index 4dfcbf5..faeccd8 100644
--- a/crypto/bio/bio_test.cc
+++ b/crypto/bio/bio_test.cc
@@ -39,10 +39,8 @@
#else
#include <fcntl.h>
#include <io.h>
-OPENSSL_MSVC_PRAGMA(warning(push, 3))
#include <winsock2.h>
#include <ws2tcpip.h>
-OPENSSL_MSVC_PRAGMA(warning(pop))
#endif
namespace {
diff --git a/crypto/bio/connect.cc b/crypto/bio/connect.cc
index 8175b9d..21f09b9 100644
--- a/crypto/bio/connect.cc
+++ b/crypto/bio/connect.cc
@@ -26,10 +26,8 @@
#include <sys/socket.h>
#include <unistd.h>
#else
-OPENSSL_MSVC_PRAGMA(warning(push, 3))
#include <winsock2.h>
#include <ws2tcpip.h>
-OPENSSL_MSVC_PRAGMA(warning(pop))
#endif
#include <openssl/err.h>
diff --git a/crypto/bio/internal.h b/crypto/bio/internal.h
index 50cda5c..d06be4d 100644
--- a/crypto/bio/internal.h
+++ b/crypto/bio/internal.h
@@ -26,9 +26,7 @@
#include <sys/types.h>
#include <sys/socket.h>
#else
-OPENSSL_MSVC_PRAGMA(warning(push, 3))
#include <winsock2.h>
-OPENSSL_MSVC_PRAGMA(warning(pop))
typedef int socklen_t;
#endif
#endif // !OPENSSL_NO_SOCK
diff --git a/crypto/bio/socket.cc b/crypto/bio/socket.cc
index 22ef4f7..672c9b5 100644
--- a/crypto/bio/socket.cc
+++ b/crypto/bio/socket.cc
@@ -22,10 +22,7 @@
#if !defined(OPENSSL_WINDOWS)
#include <unistd.h>
#else
-OPENSSL_MSVC_PRAGMA(warning(push, 3))
#include <winsock2.h>
-OPENSSL_MSVC_PRAGMA(warning(pop))
-
OPENSSL_MSVC_PRAGMA(comment(lib, "Ws2_32.lib"))
#endif
diff --git a/crypto/bio/socket_helper.cc b/crypto/bio/socket_helper.cc
index 4b88020..7d1e2a3 100644
--- a/crypto/bio/socket_helper.cc
+++ b/crypto/bio/socket_helper.cc
@@ -30,10 +30,8 @@
#include <netdb.h>
#include <unistd.h>
#else
-OPENSSL_MSVC_PRAGMA(warning(push, 3))
#include <winsock2.h>
#include <ws2tcpip.h>
-OPENSSL_MSVC_PRAGMA(warning(pop))
#endif
#include "internal.h"
diff --git a/crypto/cpu_intel.cc b/crypto/cpu_intel.cc
index 0648bdb..722c33f 100644
--- a/crypto/cpu_intel.cc
+++ b/crypto/cpu_intel.cc
@@ -23,10 +23,8 @@
#include <string.h>
#if defined(_MSC_VER)
-OPENSSL_MSVC_PRAGMA(warning(push, 3))
#include <immintrin.h>
#include <intrin.h>
-OPENSSL_MSVC_PRAGMA(warning(pop))
#endif
#include "internal.h"
diff --git a/crypto/err/err.cc b/crypto/err/err.cc
index 82ba0a6..d84153c 100644
--- a/crypto/err/err.cc
+++ b/crypto/err/err.cc
@@ -24,9 +24,7 @@
#include <string.h>
#if defined(OPENSSL_WINDOWS)
-OPENSSL_MSVC_PRAGMA(warning(push, 3))
#include <windows.h>
-OPENSSL_MSVC_PRAGMA(warning(pop))
#endif
#include <openssl/mem.h>
diff --git a/crypto/err/err_test.cc b/crypto/err/err_test.cc
index 5b634d2..d62d07f 100644
--- a/crypto/err/err_test.cc
+++ b/crypto/err/err_test.cc
@@ -26,9 +26,7 @@
#include "./internal.h"
#if defined(OPENSSL_WINDOWS)
-OPENSSL_MSVC_PRAGMA(warning(push, 3))
#include <windows.h>
-OPENSSL_MSVC_PRAGMA(warning(pop))
#else
#include <errno.h>
#endif
diff --git a/crypto/fipsmodule/bn/internal.h b/crypto/fipsmodule/bn/internal.h
index 938d275..9dfc114 100644
--- a/crypto/fipsmodule/bn/internal.h
+++ b/crypto/fipsmodule/bn/internal.h
@@ -19,9 +19,7 @@
#include <openssl/bn.h>
#if defined(OPENSSL_X86_64) && defined(_MSC_VER)
-OPENSSL_MSVC_PRAGMA(warning(push, 3))
#include <intrin.h>
-OPENSSL_MSVC_PRAGMA(warning(pop))
#pragma intrinsic(__umulh, _umul128)
#endif
diff --git a/crypto/internal.h b/crypto/internal.h
index 89da07f..d32b388 100644
--- a/crypto/internal.h
+++ b/crypto/internal.h
@@ -21,6 +21,7 @@
#include <openssl/thread.h>
#include <assert.h>
+#include <stdlib.h>
#include <string.h>
#if defined(BORINGSSL_CONSTANT_TIME_VALIDATION)
@@ -47,9 +48,7 @@
#endif
#if defined(OPENSSL_WINDOWS_THREADS)
-OPENSSL_MSVC_PRAGMA(warning(push, 3))
#include <windows.h>
-OPENSSL_MSVC_PRAGMA(warning(pop))
#endif
#if defined(__cplusplus)
@@ -783,9 +782,6 @@
return __builtin_bswap64(x);
}
#elif defined(_MSC_VER)
-OPENSSL_MSVC_PRAGMA(warning(push, 3))
-#include <stdlib.h>
-OPENSSL_MSVC_PRAGMA(warning(pop))
#pragma intrinsic(_byteswap_uint64, _byteswap_ulong, _byteswap_ushort)
static inline uint16_t CRYPTO_bswap2(uint16_t x) { return _byteswap_ushort(x); }
diff --git a/crypto/mem.cc b/crypto/mem.cc
index aed60a8..83a1af7 100644
--- a/crypto/mem.cc
+++ b/crypto/mem.cc
@@ -24,9 +24,7 @@
#include <openssl/err.h>
#if defined(OPENSSL_WINDOWS)
-OPENSSL_MSVC_PRAGMA(warning(push, 3))
#include <windows.h>
-OPENSSL_MSVC_PRAGMA(warning(pop))
#endif
#if defined(BORINGSSL_MALLOC_FAILURE_TESTING)
diff --git a/crypto/rand/windows.cc b/crypto/rand/windows.cc
index 8413482..59df467 100644
--- a/crypto/rand/windows.cc
+++ b/crypto/rand/windows.cc
@@ -23,8 +23,6 @@
#include <limits.h>
#include <stdlib.h>
-OPENSSL_MSVC_PRAGMA(warning(push, 3))
-
#include <windows.h>
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) && \
@@ -33,8 +31,6 @@
OPENSSL_MSVC_PRAGMA(comment(lib, "bcrypt.lib"))
#endif // WINAPI_PARTITION_APP && !WINAPI_PARTITION_DESKTOP
-OPENSSL_MSVC_PRAGMA(warning(pop))
-
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) && \
!WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
diff --git a/crypto/test/abi_test.cc b/crypto/test/abi_test.cc
index e37b675..2c300f4 100644
--- a/crypto/test/abi_test.cc
+++ b/crypto/test/abi_test.cc
@@ -40,10 +40,8 @@
#include <unistd.h>
#elif defined(OPENSSL_WINDOWS)
#define SUPPORTS_UNWIND_TEST
-OPENSSL_MSVC_PRAGMA(warning(push, 3))
#include <windows.h>
#include <dbghelp.h>
-OPENSSL_MSVC_PRAGMA(warning(pop))
#endif
#endif // X86_64 && SUPPORTS_ABI_TEST
diff --git a/crypto/test/file_util.cc b/crypto/test/file_util.cc
index 6a9c0ba..20d53f9 100644
--- a/crypto/test/file_util.cc
+++ b/crypto/test/file_util.cc
@@ -17,9 +17,7 @@
#include <stdlib.h>
#if defined(OPENSSL_WINDOWS)
-OPENSSL_MSVC_PRAGMA(warning(push, 3))
#include <windows.h>
-OPENSSL_MSVC_PRAGMA(warning(pop))
#else
#include <fcntl.h>
#include <sys/stat.h>
diff --git a/crypto/test/gtest_main.h b/crypto/test/gtest_main.h
index fee5fe3..8cb2900 100644
--- a/crypto/test/gtest_main.h
+++ b/crypto/test/gtest_main.h
@@ -24,9 +24,7 @@
#include <openssl/err.h>
#if defined(OPENSSL_WINDOWS)
-OPENSSL_MSVC_PRAGMA(warning(push, 3))
#include <winsock2.h>
-OPENSSL_MSVC_PRAGMA(warning(pop))
#else
#include <signal.h>
#endif
diff --git a/crypto/thread_win.cc b/crypto/thread_win.cc
index e50fc62..4e22c47 100644
--- a/crypto/thread_win.cc
+++ b/crypto/thread_win.cc
@@ -18,9 +18,7 @@
#if defined(OPENSSL_WINDOWS_THREADS)
-OPENSSL_MSVC_PRAGMA(warning(push, 3))
#include <windows.h>
-OPENSSL_MSVC_PRAGMA(warning(pop))
#include <assert.h>
#include <stdlib.h>
diff --git a/decrepit/cast/cast.cc b/decrepit/cast/cast.cc
index 6e4c000..37e4684 100644
--- a/decrepit/cast/cast.cc
+++ b/decrepit/cast/cast.cc
@@ -17,9 +17,7 @@
#include <openssl/obj.h>
#if defined(OPENSSL_WINDOWS)
-OPENSSL_MSVC_PRAGMA(warning(push, 3))
#include <intrin.h>
-OPENSSL_MSVC_PRAGMA(warning(pop))
#endif
#include "../../crypto/fipsmodule/cipher/internal.h"
diff --git a/ssl/internal.h b/ssl/internal.h
index 5c51c60..5ec2c95 100644
--- a/ssl/internal.h
+++ b/ssl/internal.h
@@ -50,9 +50,7 @@
#if defined(OPENSSL_WINDOWS)
// Windows defines struct timeval in winsock2.h.
-OPENSSL_MSVC_PRAGMA(warning(push, 3))
#include <winsock2.h>
-OPENSSL_MSVC_PRAGMA(warning(pop))
#else
#include <sys/time.h>
#endif
diff --git a/ssl/ssl_test.cc b/ssl/ssl_test.cc
index d172588..cdc2a6e 100644
--- a/ssl/ssl_test.cc
+++ b/ssl/ssl_test.cc
@@ -49,9 +49,7 @@
#if defined(OPENSSL_WINDOWS)
// Windows defines struct timeval in winsock2.h.
-OPENSSL_MSVC_PRAGMA(warning(push, 3))
#include <winsock2.h>
-OPENSSL_MSVC_PRAGMA(warning(pop))
#else
#include <sys/time.h>
#endif
diff --git a/ssl/test/fuzzer.h b/ssl/test/fuzzer.h
index 7478ab0..79217e5 100644
--- a/ssl/test/fuzzer.h
+++ b/ssl/test/fuzzer.h
@@ -38,9 +38,7 @@
#if defined(OPENSSL_WINDOWS)
// Windows defines struct timeval in winsock2.h.
-OPENSSL_MSVC_PRAGMA(warning(push, 3))
#include <winsock2.h>
-OPENSSL_MSVC_PRAGMA(warning(pop))
#else
#include <sys/time.h>
#endif
diff --git a/ssl/test/packeted_bio.h b/ssl/test/packeted_bio.h
index 3591c05..cec7098 100644
--- a/ssl/test/packeted_bio.h
+++ b/ssl/test/packeted_bio.h
@@ -21,9 +21,7 @@
#include <openssl/bio.h>
#if defined(OPENSSL_WINDOWS)
-OPENSSL_MSVC_PRAGMA(warning(push, 3))
#include <winsock2.h>
-OPENSSL_MSVC_PRAGMA(warning(pop))
#else
#include <sys/time.h>
#endif
diff --git a/ssl/test/test_config.cc b/ssl/test/test_config.cc
index 050923e..35171ab 100644
--- a/ssl/test/test_config.cc
+++ b/ssl/test/test_config.cc
@@ -43,9 +43,7 @@
#if defined(OPENSSL_WINDOWS)
// Windows defines struct timeval in winsock2.h.
-OPENSSL_MSVC_PRAGMA(warning(push, 3))
#include <winsock2.h>
-OPENSSL_MSVC_PRAGMA(warning(pop))
#else
#include <sys/time.h>
#endif
diff --git a/tool/client.cc b/tool/client.cc
index ed9b5bd..0839d48 100644
--- a/tool/client.cc
+++ b/tool/client.cc
@@ -19,9 +19,7 @@
#if !defined(OPENSSL_WINDOWS)
#include <sys/select.h>
#else
-OPENSSL_MSVC_PRAGMA(warning(push, 3))
#include <winsock2.h>
-OPENSSL_MSVC_PRAGMA(warning(pop))
#endif
#include <openssl/err.h>
diff --git a/tool/digest.cc b/tool/digest.cc
index b3b2ffd..008e8f5 100644
--- a/tool/digest.cc
+++ b/tool/digest.cc
@@ -32,9 +32,7 @@
#define O_BINARY 0
#endif
#else
-OPENSSL_MSVC_PRAGMA(warning(push, 3))
#include <windows.h>
-OPENSSL_MSVC_PRAGMA(warning(pop))
#include <io.h>
#if !defined(PATH_MAX)
#define PATH_MAX MAX_PATH
diff --git a/tool/speed.cc b/tool/speed.cc
index 8bc3eef..b9bca8e 100644
--- a/tool/speed.cc
+++ b/tool/speed.cc
@@ -52,9 +52,7 @@
#include <openssl/trust_token.h>
#if defined(OPENSSL_WINDOWS)
-OPENSSL_MSVC_PRAGMA(warning(push, 3))
#include <windows.h>
-OPENSSL_MSVC_PRAGMA(warning(pop))
#elif defined(OPENSSL_APPLE)
#include <sys/time.h>
#else
diff --git a/tool/transport_common.cc b/tool/transport_common.cc
index 264db13..141cf36 100644
--- a/tool/transport_common.cc
+++ b/tool/transport_common.cc
@@ -50,10 +50,8 @@
#include <utility>
#include <io.h>
-OPENSSL_MSVC_PRAGMA(warning(push, 3))
#include <winsock2.h>
#include <ws2tcpip.h>
-OPENSSL_MSVC_PRAGMA(warning(pop))
OPENSSL_MSVC_PRAGMA(comment(lib, "Ws2_32.lib"))
#endif