src/share/vm/utilities/growableArray.hpp : VisualStudio pragmas in	shared code
    Baesken, Matthias 
    matthias.baesken at sap.com
       
    Tue Dec 15 14:39:45 UTC 2015
    
    
  
Hello,
     while  Visual Studio pragmas in shared code are usually guarded with  _MSC_VER in the hotspot codebase
( see for example   taskqueue.hpp or  compressedStream.cpp ) , the guarding is missing in   src/share/vm/utilities/growableArray.hpp  ,
which is not really a "good thing"  for other compilers .
So I suggest to add the guarding  _MSC_VER - check  in src/share/vm/utilities/growableArray.hpp   too :
@@ -170,5 +170,7 @@
     _data = (E*)raw_allocate(sizeof(E));
// Needed for Visual Studio 2012 and older
+#ifdef _MSC_VER
#pragma warning(suppress: 4345)
+#endif
     for (int i = 0; i < _max; i++) ::new ((void*)&_data[i]) E();
   }
@@ -423,5 +425,7 @@
     for (     ; i < _len; i++) ::new ((void*)&newData[i]) E(_data[i]);
// Needed for Visual Studio 2012 and older
+#ifdef _MSC_VER
#pragma warning(suppress: 4345)
+#endif
     for (     ; i < _max; i++) ::new ((void*)&newData[i]) E();
     for (i = 0; i < old_max; i++) _data[i].~E();
Regards, Matthias
    
    
More information about the hotspot-dev
mailing list