test icon indicating copy to clipboard operation
test copied to clipboard

Using BOOST_REQUIRE () should not cause "comparison of integers of different" warning

Open k15tfu opened this issue 7 years ago • 0 comments

Hi! When I use BOOST_TEST_REQUIRE(==) the compiler generates "comparison of integers of different" warnings, but without BOOST_*() macros everything is compiled silently even with -Wall -Wextra.


#include <vector>

#include <boost/test/unit_test.hpp>

bool foo(std::vector<char>& v) {
        BOOST_TEST_REQUIRE(v.size() == 0); // warning: comparison of integers of different signs: 'const unsigned long' and 'const int'
        return v.size() == 0; // Okay
}

k15tfu avatar Feb 25 '19 21:02 k15tfu