summaryrefslogtreecommitdiff
path: root/cpp/include
diff options
context:
space:
mode:
authorBernard Normier <bernard@zeroc.com>2018-11-01 17:14:06 -0400
committerBernard Normier <bernard@zeroc.com>2018-11-01 17:14:06 -0400
commit3a763985c52246b1b804cdd7ee7bd49a82e76bd3 (patch)
treee35b1b0bdf6715ed784d0c86482355528bee81ee /cpp/include
parentVisual Studio and msbuild updates (diff)
downloadice-3a763985c52246b1b804cdd7ee7bd49a82e76bd3.tar.bz2
ice-3a763985c52246b1b804cdd7ee7bd49a82e76bd3.tar.xz
ice-3a763985c52246b1b804cdd7ee7bd49a82e76bd3.zip
Increase Visual Studio warning level to Level4
Fixes #223.
Diffstat (limited to 'cpp/include')
-rw-r--r--cpp/include/Ice/Incoming.h10
-rw-r--r--cpp/include/Ice/IncomingAsync.h10
-rw-r--r--cpp/include/Ice/Optional.h8
-rw-r--r--cpp/include/IceUtil/DisableWarnings.h9
4 files changed, 32 insertions, 5 deletions
diff --git a/cpp/include/Ice/Incoming.h b/cpp/include/Ice/Incoming.h
index 59920a0911a..24551646985 100644
--- a/cpp/include/Ice/Incoming.h
+++ b/cpp/include/Ice/Incoming.h
@@ -145,6 +145,12 @@ protected:
DispatchInterceptorCallbacks _interceptorCBs;
};
+// TODO: fix this warning
+#if defined(_MSC_VER) && (_MSC_VER >= 1900)
+# pragma warning(push)
+# pragma warning(disable:4239)
+#endif
+
class ICE_API Incoming : public IncomingBase
{
public:
@@ -215,6 +221,10 @@ private:
IncomingAsyncPtr _inAsync;
};
+#if defined(_MSC_VER) && (_MSC_VER >= 1900)
+# pragma warning(pop)
+#endif
+
}
#endif
diff --git a/cpp/include/Ice/IncomingAsync.h b/cpp/include/Ice/IncomingAsync.h
index 171b0d188e3..b03ca52b58f 100644
--- a/cpp/include/Ice/IncomingAsync.h
+++ b/cpp/include/Ice/IncomingAsync.h
@@ -45,6 +45,12 @@ public:
namespace IceInternal
{
+// TODO: fix this warning
+#if defined(_MSC_VER) && (_MSC_VER >= 1900)
+# pragma warning(push)
+# pragma warning(disable:4239)
+#endif
+
//
// We need virtual inheritance from AMDCallback, because we use multiple
// inheritance from Ice::AMDCallback for generated AMD code.
@@ -118,6 +124,10 @@ private:
const ResponseHandlerPtr _responseHandlerCopy;
};
+#if defined(_MSC_VER) && (_MSC_VER >= 1900)
+# pragma warning(pop)
+#endif
+
}
#ifndef ICE_CPP11_MAPPING
diff --git a/cpp/include/Ice/Optional.h b/cpp/include/Ice/Optional.h
index f9107f0ffa4..7f558f90834 100644
--- a/cpp/include/Ice/Optional.h
+++ b/cpp/include/Ice/Optional.h
@@ -554,6 +554,10 @@ public:
return contained_val();
}
+#ifdef _MSC_VER
+# pragma warning(push)
+# pragma warning(disable:4702) // unreachable code
+#endif
constexpr T const& value() const {
return initialized() ? contained_val() : (throw bad_optional_access("bad optional access"), contained_val());
}
@@ -562,6 +566,10 @@ public:
return initialized() ? contained_val() : (throw bad_optional_access("bad optional access"), contained_val());
}
+#ifdef _MSC_VER
+# pragma warning(pop)
+#endif
+
# endif
# if OPTIONAL_HAS_THIS_RVALUE_REFS == 1
diff --git a/cpp/include/IceUtil/DisableWarnings.h b/cpp/include/IceUtil/DisableWarnings.h
index e31ed50608a..a67f3059c55 100644
--- a/cpp/include/IceUtil/DisableWarnings.h
+++ b/cpp/include/IceUtil/DisableWarnings.h
@@ -11,8 +11,7 @@
#define ICE_UTIL_DISABLEWARNINGS_H
//
-// This header file disables or makes non-fatal various compiler warnings that
-// we don't want.
+// This header file disables various compiler warnings that we don't want.
//
// IMPORTANT: Do *not* include this header file in another public header file!
// Doing this may potentially disable the warnings in the source
@@ -25,11 +24,11 @@
//
#if defined(_MSC_VER)
# define _CRT_SECURE_NO_DEPRECATE 1 // C4996 '<C function>' was declared deprecated
-# pragma warning( 4 : 4996 ) // C4996 '<function>' was declared deprecated
-# pragma warning( 4 : 4800 ) // C4800 forcing value to bool 'true' or 'false' (performance warning)
+# pragma warning(disable:4996) // C4996 '<function>' was declared deprecated
+# pragma warning(disable:4800) // C4800 forcing value to bool 'true' or 'false' (performance warning)
# if (_MSC_VER < 1700)
-# pragma warning( 4 : 4355 ) // C4355 'this' : used in base member initializer list
+# pragma warning(disable:4355) // C4355 'this' : used in base member initializer list
# endif
#endif