changeset 59986:b7e994a0a856

8248548: Use DISABLED_WARNINGS for globally disabled warnings on Visual Studio in Hotspot Reviewed-by: kbarrett, erikj
author ihse
date Tue, 30 Jun 2020 16:26:24 +0200
parents 2d00f2892c1d
children d1f7e454fc99
files make/hotspot/lib/CompileGtest.gmk make/hotspot/lib/CompileJvm.gmk src/hotspot/share/utilities/globalDefinitions_visCPP.hpp
diffstat 3 files changed, 2 insertions(+), 27 deletions(-) [+]
line wrap: on
line diff
--- a/make/hotspot/lib/CompileGtest.gmk	Tue Jun 30 16:23:34 2020 +0200
+++ b/make/hotspot/lib/CompileGtest.gmk	Tue Jun 30 16:26:24 2020 +0200
@@ -106,6 +106,7 @@
     DISABLED_WARNINGS_clang := $(DISABLED_WARNINGS_clang) \
         undef switch format-nonliteral tautological-undefined-compare \
         self-assign-overloaded, \
+    DISABLED_WARNINGS_microsoft := $(DISABLED_WARNINGS_microsoft), \
     LDFLAGS := $(JVM_LDFLAGS), \
     LDFLAGS_unix := -L$(JVM_OUTPUTDIR)/libgtest, \
     LIBS := $(JVM_LIBS), \
--- a/make/hotspot/lib/CompileJvm.gmk	Tue Jun 30 16:23:34 2020 +0200
+++ b/make/hotspot/lib/CompileJvm.gmk	Tue Jun 30 16:26:24 2020 +0200
@@ -95,9 +95,7 @@
 
 DISABLED_WARNINGS_xlc := tautological-compare shift-negative-value
 
-DISABLED_WARNINGS_microsoft :=
-
-
+DISABLED_WARNINGS_microsoft := 4100 4127 4201 4244 4291 4351 4511 4512 4514 4996
 
 ################################################################################
 # Platform specific setup
--- a/src/hotspot/share/utilities/globalDefinitions_visCPP.hpp	Tue Jun 30 16:23:34 2020 +0200
+++ b/src/hotspot/share/utilities/globalDefinitions_visCPP.hpp	Tue Jun 30 16:26:24 2020 +0200
@@ -111,7 +111,6 @@
 // Miscellaneous
 
 // Visual Studio 2005 deprecates POSIX names - use ISO C++ names instead
-#if _MSC_VER >= 1400
 #define open _open
 #define close _close
 #define read  _read
@@ -119,34 +118,11 @@
 #define lseek _lseek
 #define unlink _unlink
 #define strdup _strdup
-#endif
 
-#if _MSC_VER < 1800
-// Visual Studio 2013 introduced strtoull(); before, one has to use _strtoui64() instead.
-#define strtoull _strtoui64
-// Visual Studio prior to 2013 had no va_copy, but could safely copy va_list by assignement
-#define va_copy(dest, src) dest = src
-// Fixes some wrong warnings about 'this' : used in base member initializer list
-#pragma warning( disable : 4355 )
-#endif
-
-
-#pragma warning( disable : 4100 ) // unreferenced formal parameter
-#pragma warning( disable : 4127 ) // conditional expression is constant
-#pragma warning( disable : 4514 ) // unreferenced inline function has been removed
-#pragma warning( disable : 4244 ) // possible loss of data
-#pragma warning( disable : 4512 ) // assignment operator could not be generated
-#pragma warning( disable : 4201 ) // nonstandard extension used : nameless struct/union (needed in windows.h)
-#pragma warning( disable : 4511 ) // copy constructor could not be generated
-#pragma warning( disable : 4291 ) // no matching operator delete found; memory will not be freed if initialization thows an exception
-#pragma warning( disable : 4351 ) // new behavior: elements of array ... will be default initialized
 #ifdef CHECK_UNHANDLED_OOPS
 #pragma warning( disable : 4521 ) // class has multiple copy ctors of a single type
 #pragma warning( disable : 4522 ) // class has multiple assignment operators of a single type
 #endif // CHECK_UNHANDLED_OOPS
-#if _MSC_VER >= 1400
-#pragma warning( disable : 4996 ) // unsafe string functions. Same as define _CRT_SECURE_NO_WARNINGS/_CRT_SECURE_NO_DEPRICATE
-#endif
 
 // Formatting.
 #define FORMAT64_MODIFIER "I64"