diff --git a/include/fc/crypto/ripemd160.hpp b/include/fc/crypto/ripemd160.hpp index 6e73917..389d677 100644 --- a/include/fc/crypto/ripemd160.hpp +++ b/include/fc/crypto/ripemd160.hpp @@ -45,7 +45,7 @@ class ripemd160 ripemd160 result(); private: - struct impl; + class impl; fc::fwd my; }; diff --git a/include/fc/exception/exception.hpp b/include/fc/exception/exception.hpp index 1c1e7dc..ec100f4 100644 --- a/include/fc/exception/exception.hpp +++ b/include/fc/exception/exception.hpp @@ -446,11 +446,11 @@ namespace fc catch( fc::exception& er ) { \ FC_RETHROW_EXCEPTION( er, LOG_LEVEL, FORMAT, __VA_ARGS__ ); \ } catch( const std::exception& e ) { \ - fc::exception fce( \ + throw fc::exception( \ FC_LOG_MESSAGE( LOG_LEVEL, "${what}: " FORMAT,__VA_ARGS__("what",e.what())), \ fc::std_exception_code,\ typeid(e).name(), \ - e.what() ) ; throw fce;\ + e.what() ) ;\ } catch( ... ) { \ throw fc::unhandled_exception( \ FC_LOG_MESSAGE( LOG_LEVEL, FORMAT,__VA_ARGS__), \ @@ -461,11 +461,11 @@ namespace fc catch( fc::exception& er ) { \ FC_RETHROW_EXCEPTION( er, warn, "", FC_FORMAT_ARG_PARAMS(__VA_ARGS__) ); \ } catch( const std::exception& e ) { \ - fc::exception fce( \ + throw fc::exception( \ FC_LOG_MESSAGE( warn, "${what}: ",FC_FORMAT_ARG_PARAMS(__VA_ARGS__)("what",e.what())), \ fc::std_exception_code,\ typeid(e).name(), \ - e.what() ) ; throw fce;\ + e.what() ) ;\ } catch( ... ) { \ throw fc::unhandled_exception( \ FC_LOG_MESSAGE( warn, "",FC_FORMAT_ARG_PARAMS(__VA_ARGS__)), \ diff --git a/include/fc/log/log_message.hpp b/include/fc/log/log_message.hpp index a320b66..e9e1a68 100644 --- a/include/fc/log/log_message.hpp +++ b/include/fc/log/log_message.hpp @@ -147,7 +147,7 @@ FC_REFLECT_TYPENAME( fc::log_message ); * @param LOG_LEVEL - a valid log_level::Enum name. */ #define FC_LOG_CONTEXT(LOG_LEVEL) \ - fc::log_context( fc::log_level::LOG_LEVEL, __FILE__, __LINE__, __func__ ) + fc::log_context( fc::log_level::LOG_LEVEL, (const char*)__FILE__, __LINE__, (const char*)__func__ ) /** * @def FC_LOG_MESSAGE(LOG_LEVEL,FORMAT,...) diff --git a/src/crypto/crc.cpp b/src/crypto/crc.cpp index 3b95455..7fa8cb1 100644 --- a/src/crypto/crc.cpp +++ b/src/crypto/crc.cpp @@ -606,6 +606,8 @@ static const uint32_t crc_c[256] = { uint64_t _mm_crc32_u64(uint64_t a, uint64_t b ) { + // Squelch warning about unusued variable crc_c + (void)(crc_c); return crc32cSlicingBy8(a, (unsigned char*)&b, sizeof(b)); } /* diff --git a/tests/crypto/bigint_test.cpp b/tests/crypto/bigint_test.cpp index 5473b7a..0d983b3 100644 --- a/tests/crypto/bigint_test.cpp +++ b/tests/crypto/bigint_test.cpp @@ -46,7 +46,9 @@ BOOST_AUTO_TEST_CASE(bigint_test_2) BOOST_CHECK( bi_accu >= a_1 ); } while ( bi_accu.log2() <= 128 ); - bi_accu = bi_accu; + // Test self-assignment (a=a) has no effect, but throw in some arcanity to avoid a compiler warning + const volatile auto* bi_accu_self = &bi_accu; + bi_accu = const_cast(*bi_accu_self); BOOST_CHECK( bi_accu && !bi_accu.is_negative() && bi_accu != bi_1 ); diff --git a/tests/io/json_tests.cpp b/tests/io/json_tests.cpp index d56f801..90872e8 100644 --- a/tests/io/json_tests.cpp +++ b/tests/io/json_tests.cpp @@ -171,7 +171,7 @@ static bool equal( const fc::variant& a, const fc::variant& b ) return true; case fc::variant::type_id::blob_type: default: - FC_THROW_EXCEPTION( fc::invalid_arg_exception, "Unsupported variant type: " + a.get_type() ); + FC_THROW_EXCEPTION( fc::invalid_arg_exception, "Unsupported variant type: {t}", ( "t", a.get_type() ) ); } } @@ -348,7 +348,7 @@ BOOST_AUTO_TEST_CASE(rethrow_test) } FC_RETHROW_EXCEPTIONS( warn, "Argh! ${biggie}", ("biggie",biggie) ) }; BOOST_CHECK_THROW( test_r(), fc::unknown_host_exception ); - auto test_lr = [&biggie](){ + auto test_lr = [](){ try { FC_THROW_EXCEPTION( fc::unknown_host_exception, "WTF?" ); } FC_LOG_AND_RETHROW() };