From b1790e463e0120713604274e1dfda39f7d84ad76 Mon Sep 17 00:00:00 2001 From: Daniel James Date: Thu, 8 Aug 2013 22:01:18 +0000 Subject: [PATCH] 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. [SVN r85248] --- include/boost/functional/hash/hash.hpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/include/boost/functional/hash/hash.hpp b/include/boost/functional/hash/hash.hpp index aa4e49f..0adf9c9 100644 --- a/include/boost/functional/hash/hash.hpp +++ b/include/boost/functional/hash/hash.hpp @@ -27,6 +27,13 @@ #include #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 @@ namespace boost #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