Update test/Jamfile, turn warnings-as-errors=on, fix g++ warning

This commit is contained in:
Peter Dimov
2021-10-16 22:22:29 +03:00
parent 3cf502b34c
commit 3f2612d36e
2 changed files with 9 additions and 9 deletions

View File

@@ -96,7 +96,8 @@ namespace boost
static std::size_t fn( T v ) static std::size_t fn( T v )
{ {
// 18446744073709551557ULL = 2^64-59, biggest prime under 2^64 // 18446744073709551557ULL = 2^64-59, biggest prime under 2^64
return static_cast<std::size_t>( static_cast<typename boost::make_unsigned<T>::type>( v ) % 18446744073709551557ULL ); // we have to use boost::uint64_t( -59 ), because g++ warns in C++03 mode
return static_cast<std::size_t>( static_cast<typename boost::make_unsigned<T>::type>( v ) % static_cast<boost::uint64_t>( -59 ) );
} }
}; };

View File

@@ -7,15 +7,14 @@ import testing ;
project hash-tests project hash-tests
: requirements : requirements
<warnings>all <warnings>pedantic
<toolset>intel:<warnings>on <toolset>intel:<warnings>on
#<toolset>intel:<cxxflags>-strict-ansi <toolset>gcc:<cxxflags>"-Wstrict-aliasing -Wsign-promo -Wunused-parameter -Wconversion -Wfloat-equal -Wshadow"
<toolset>gcc:<cxxflags>"-pedantic -Wstrict-aliasing -fstrict-aliasing -Wextra -Wsign-promo -Wunused-parameter -Wconversion -Wfloat-equal -Wshadow" <toolset>darwin:<cxxflags>"-Wstrict-aliasing -Wsign-promo -Wunused-parameter -Wconversion -Wfloat-equal -Wshadow"
<toolset>darwin:<cxxflags>"-pedantic -Wstrict-aliasing -fstrict-aliasing -Wextra -Wsign-promo -Wunused-parameter -Wconversion -Wfloat-equal -Wshadow" <toolset>clang:<cxxflags>"-Wstrict-aliasing -Wsign-promo -Wunused-parameter -Wsign-conversion -Wconversion -Wfloat-equal -Wshadow"
<toolset>clang:<cxxflags>"-pedantic -Wstrict-aliasing -fstrict-aliasing -Wextra -Wsign-promo -Wunused-parameter -Wsign-conversion -Wconversion -Wfloat-equal -Wshadow" <toolset>msvc:<warnings-as-errors>on
#<toolset>msvc:<warnings-as-errors>on <toolset>gcc:<warnings-as-errors>on
#<toolset>gcc:<warnings-as-errors>on <toolset>clang:<warnings-as-errors>on
#<toolset>darwin:<warnings-as-errors>on
; ;
test-suite container_hash/hash test-suite container_hash/hash