From a2f3cf6f38d05d0f1881dd760e09b30eaa075ff0 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Wed, 17 Feb 2016 15:19:36 +0100 Subject: [PATCH] Suppress MSVC warning C4800 caused by static_cast(unsigned) The static_cast of an unsigned causes the following warning with MSVC: warning C4800: "'int' : forcing value to bool 'true' or 'false' (performance warning) Suppress the warning for the cast in question as is done in other places of Boost. --- include/boost/crc.hpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/boost/crc.hpp b/include/boost/crc.hpp index 87f6ebf..80a8db5 100644 --- a/include/boost/crc.hpp +++ b/include/boost/crc.hpp @@ -1774,7 +1774,14 @@ crc_basic::process_bits unsigned char const high_bit_mask = 1u << ( CHAR_BIT - 1u ); for ( std::size_t i = bit_length ; i > 0u ; --i, bits <<= 1u ) { +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable:4800) +#endif process_bit( static_cast(bits & high_bit_mask) ); +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif } }