This is an automated email from the ASF dual-hosted git repository.

bbender pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode-native.git


The following commit(s) were added to refs/heads/develop by this push:
     new 3c40a5d  GEODE-8921: Enable "extra qualification" warning in Windows 
builds (#741)
3c40a5d is described below

commit 3c40a5dbd41e4ab2397b506432faac2f26713c82
Author: Blake Bender <[email protected]>
AuthorDate: Fri Feb 5 12:09:32 2021 -0800

    GEODE-8921: Enable "extra qualification" warning in Windows builds (#741)
    
    - This would bite developers from time to time, because code with extra
      qualifications will build on Windows, but all other platforms will
      flag it with a warning and break the build.
    - Disable warning in a couple of test files.  One of the boost log headers 
triggers warning C4596
    - Fix tabs.  Indentation was messed up in a couple of places
---
 CMakeLists.txt                                 |  5 +++--
 clicache/src/Cache.hpp                         |  2 +-
 clicache/src/DataInput.hpp                     |  6 +++---
 clicache/src/impl/PdxHelper.hpp                |  4 ++--
 cppcache/integration/benchmark/RegionBM.cpp    | 11 +++++++++++
 cppcache/integration/framework/GfshExecute.cpp | 11 +++++++++++
 6 files changed, 31 insertions(+), 8 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1ab6620..841c016 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -280,8 +280,9 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
 
   target_compile_options(_WarningsAsError INTERFACE
     /WX
-       /wd4996
-       )
+    /wd4996
+    /we4596
+  )
 
   set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /ignore:4099")
   set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /ignore:4099")
diff --git a/clicache/src/Cache.hpp b/clicache/src/Cache.hpp
index ab7bce4..11ab23d 100644
--- a/clicache/src/Cache.hpp
+++ b/clicache/src/Cache.hpp
@@ -266,7 +266,7 @@ namespace Apache
         virtual DataInput^ CreateDataInput(array<Byte>^ buffer, System::Int32 
len);
         virtual DataInput^ CreateDataInput(array<Byte>^ buffer);
         
-        virtual DataOutput^ Cache::CreateDataOutput();
+        virtual DataOutput^ CreateDataOutput();
 
         /// <summary>
         /// Returns a PoolFactory that can be used to create a Pool and that 
provides
diff --git a/clicache/src/DataInput.hpp b/clicache/src/DataInput.hpp
index fa10265..0b6f4ce 100644
--- a/clicache/src/DataInput.hpp
+++ b/clicache/src/DataInput.hpp
@@ -453,9 +453,9 @@ namespace Apache
           obj = ReadSBytes();
         }        
 
-        void DataInput::ReadObject(array<UInt16>^% obj);
-        void DataInput::ReadObject(array<UInt32>^% obj);
-        void DataInput::ReadObject(array<UInt64>^% obj);
+        void ReadObject(array<UInt16>^% obj);
+        void ReadObject(array<UInt32>^% obj);
+        void ReadObject(array<UInt64>^% obj);
 
         template <typename mType>
         void ReadObject(array<mType>^ %objArray)
diff --git a/clicache/src/impl/PdxHelper.hpp b/clicache/src/impl/PdxHelper.hpp
index 4a47305..cf35599 100644
--- a/clicache/src/impl/PdxHelper.hpp
+++ b/clicache/src/impl/PdxHelper.hpp
@@ -46,7 +46,7 @@ namespace Apache
 
           static IPdxSerializable^ DeserializePdx(DataInput^ dataOutput, bool 
forceDeserialize, const native::SerializationRegistry* serializationRegistry);
 
-          static IPdxSerializable^ PdxHelper::DeserializePdx(DataInput^ 
dataInput, bool forceDeserialize, int typeId, int length, const 
native::SerializationRegistry* serializationRegistry);
+          static IPdxSerializable^ DeserializePdx(DataInput^ dataInput, bool 
forceDeserialize, int typeId, int length, const native::SerializationRegistry* 
serializationRegistry);
 
           literal Byte PdxHeader = 8;
 
@@ -54,7 +54,7 @@ namespace Apache
 
           static Int32 ReadInt16(System::Byte* offsetPosition);
 
-                                       static Int32 
PdxHelper::ReadUInt16(System::Byte* offsetPosition);
+          static Int32 ReadUInt16(System::Byte* offsetPosition);
 
           static Int32 ReadByte(System::Byte* offsetPosition);
 
diff --git a/cppcache/integration/benchmark/RegionBM.cpp 
b/cppcache/integration/benchmark/RegionBM.cpp
index 8ca972f..06877ef 100644
--- a/cppcache/integration/benchmark/RegionBM.cpp
+++ b/cppcache/integration/benchmark/RegionBM.cpp
@@ -19,6 +19,17 @@
 #include <framework/Cluster.h>
 #include <framework/Gfsh.h>
 
+// Disable warning for "extra qualifications" here.  One of the boost log
+// headers triggers this warning.  Note: use of disable pragma here is
+// intentional - attempts to use push/pop as you ordinarily should just
+// yielded a gripe from the MS tools that "warning number '4596' is not a
+// valid compiler warning". re-enabling the warning after the include
+// fails in the same way, so just leave it disabled for the rest of the
+// file.  This is safe, since the warning can only trigger inside a class
+// declaration, of which there are none in this file.
+#ifdef WIN32
+#pragma warning(disable : 4596)
+#endif
 #include <boost/log/core.hpp>
 #include <boost/log/expressions.hpp>
 #include <boost/log/trivial.hpp>
diff --git a/cppcache/integration/framework/GfshExecute.cpp 
b/cppcache/integration/framework/GfshExecute.cpp
index 4e83416..d53fb1e 100644
--- a/cppcache/integration/framework/GfshExecute.cpp
+++ b/cppcache/integration/framework/GfshExecute.cpp
@@ -19,6 +19,17 @@
 
 #include <mutex>
 
+// Disable warning for "extra qualifications" here.  One of the boost log
+// headers triggers this warning.  Note: use of disable pragma here is 
+// intentional - attempts to use push/pop as you ordinarily should just 
+// yielded a gripe from the MS tools that "warning number '4596' is not a 
+// valid compiler warning". re-enabling the warning after the include
+// fails in the same way, so just leave it disabled for the rest of the
+// file.  This is safe, since the warning can only trigger inside a class
+// declaration, of which there are none in this file.
+#ifdef WIN32
+#pragma warning(disable: 4596)
+#endif
 #include <boost/log/trivial.hpp>
 
 #if defined(_WINDOWS)

Reply via email to