Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r85248 - trunk/boost/functional/hash
From: dnljms_at_[hidden]
Date: 2013-08-08 18:01:18


Author: danieljames
Date: 2013-08-08 18:01:18 EDT (Thu, 08 Aug 2013)
New Revision: 85248
URL: http://svn.boost.org/trac/boost/changeset/85248

Log:
Fix Visual C++ warning in hash. Refs #8568.

I changed this a little from the patch on #8568. I moved the pragmas to the
start and end of the file because I don't like to little the body of the code
with them (this does mean I've disabled a potentially useful warning, but the
code is pretty stable nowadays).

I also removed the version checks, as the warning should be present in later
versions.

Text files modified:
   trunk/boost/functional/hash/hash.hpp | 11 +++++++++++
   1 files changed, 11 insertions(+), 0 deletions(-)

Modified: trunk/boost/functional/hash/hash.hpp
==============================================================================
--- trunk/boost/functional/hash/hash.hpp Thu Aug 8 17:22:52 2013 (r85247)
+++ trunk/boost/functional/hash/hash.hpp 2013-08-08 18:01:18 EDT (Thu, 08 Aug 2013) (r85248)
@@ -27,6 +27,13 @@
 #include <typeindex>
 #endif
 
+#if defined(BOOST_MSVC)
+#pragma warning(push)
+#pragma warning(disable:6295) // Ill-defined for-loop : 'unsigned int' values
+ // are always of range '0' to '4294967295'.
+ // Loop executes infinitely.
+#endif
+
 #if BOOST_WORKAROUND(__GNUC__, < 3) \
     && !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION)
 #define BOOST_HASH_CHAR_TRAITS string_char_traits
@@ -518,6 +525,10 @@
 
 #undef BOOST_HASH_CHAR_TRAITS
 
+#if defined(BOOST_MSVC)
+#pragma warning(pop)
+#endif
+
 #endif // BOOST_FUNCTIONAL_HASH_HASH_HPP
 
 // Include this outside of the include guards in case the file is included


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk