test: Correct outstanding -Werror=sign-compare errors #22176

pull Empact wants to merge 1 commits into bitcoin:master from Empact:2021-06-sign-compare changing 2 files +5 −5
  1. Empact commented at 4:07 am on June 7, 2021: member

    I’m unclear on why these aren’t failing on CI, but they failed for me locally, e.g.:

     0In file included from /usr/local/include/boost/test/test_tools.hpp:46:
     1/usr/local/include/boost/test/tools/old/impl.hpp:107:17: error: comparison of integers of different signs: 'const unsigned int' and 'const int' [-Werror,-Wsign-compare]
     2    return left == right;
     3           ~~~~ ^  ~~~~~
     4/usr/local/include/boost/test/tools/old/impl.hpp:130:16: note: in instantiation of function template specialization 'boost::test_tools::tt_detail::equal_impl<unsigned int, int>' requested here
     5        return equal_impl( left, right );
     6               ^
     7/usr/local/include/boost/test/tools/old/impl.hpp:145:16: note: in instantiation of function template specialization 'boost::test_tools::tt_detail::equal_impl_frwd::call_impl<unsigned int, int>' requested here
     8        return call_impl( left, right, left_is_array() );
     9               ^
    10/usr/local/include/boost/test/tools/old/impl.hpp:92:50: note: in instantiation of function template specialization 'boost::test_tools::tt_detail::equal_impl_frwd::operator()<unsigned int, int>' requested here
    11BOOST_PP_REPEAT( BOOST_TEST_MAX_PREDICATE_ARITY, IMPL_FRWD, _ )
    12                                                 ^
    13/usr/local/include/boost/preprocessor/repetition/repeat.hpp:30:26: note: expanded from macro 'BOOST_PP_REPEAT'
    14                         ^
    15/usr/local/include/boost/preprocessor/cat.hpp:22:32: note: expanded from macro 'BOOST_PP_CAT'
    16                               ^
    17/usr/local/include/boost/preprocessor/cat.hpp:29:34: note: expanded from macro 'BOOST_PP_CAT_I'
    18                                 ^
    19<scratch space>:153:1: note: expanded from here
    20BOOST_PP_REPEAT_1
    21^
    22test/streams_tests.cpp:122:5: note: in instantiation of function template specialization 'boost::test_tools::tt_detail::check_frwd<boost::test_tools::tt_detail::equal_impl_frwd, unsigned int, int>' requested here
    23    BOOST_CHECK_EQUAL(varint, 54321);
    24    ^
    25
    26/usr/local/include/boost/test/tools/old/impl.hpp:107:17: error: comparison of integers of different signs: 'const unsigned long long' and 'const long' [-Werror,-Wsign-compare]
    27    return left == right;
    28           ~~~~ ^  ~~~~~
    29/usr/local/include/boost/test/tools/old/impl.hpp:130:16: note: in instantiation of function template specialization 'boost::test_tools::tt_detail::equal_impl<unsigned long long, long>' requested here
    30        return equal_impl( left, right );
    31               ^
    32/usr/local/include/boost/test/tools/old/impl.hpp:145:16: note: in instantiation of function template specialization 'boost::test_tools::tt_detail::equal_impl_frwd::call_impl<unsigned long long, long>' requested here
    33        return call_impl( left, right, left_is_array() );
    34               ^
    35/usr/local/include/boost/test/tools/old/impl.hpp:92:50: note: in instantiation of function template specialization 'boost::test_tools::tt_detail::equal_impl_frwd::operator()<unsigned long long, long>' requested here
    36BOOST_PP_REPEAT( BOOST_TEST_MAX_PREDICATE_ARITY, IMPL_FRWD, _ )
    37                                                 ^
    38/usr/local/include/boost/preprocessor/repetition/repeat.hpp:30:26: note: expanded from macro 'BOOST_PP_REPEAT'
    39                         ^
    40/usr/local/include/boost/preprocessor/cat.hpp:22:32: note: expanded from macro 'BOOST_PP_CAT'
    41                               ^
    42/usr/local/include/boost/preprocessor/cat.hpp:29:34: note: expanded from macro 'BOOST_PP_CAT_I'
    43                                 ^
    44<scratch space>:161:1: note: expanded from here
    45BOOST_PP_REPEAT_1
    46^
    47test/serfloat_tests.cpp:41:5: note: in instantiation of function template specialization 'boost::test_tools::tt_detail::check_frwd<boost::test_tools::tt_detail::equal_impl_frwd, unsigned long long, long>' requested here
    48    BOOST_CHECK_EQUAL(TestDouble(std::numeric_limits<double>::infinity()), 0x7ff0000000000000);
    49    ^
    
  2. fanquake added the label Tests on Jun 7, 2021
  3. MarcoFalke commented at 5:45 am on June 7, 2021: member
    Which system are you on? See also #19123
  4. test: Correct outstanding -Werror=sign-compare errors
    e.g.:
    In file included from /usr/local/include/boost/test/test_tools.hpp:46:
    /usr/local/include/boost/test/tools/old/impl.hpp:107:17: error: comparison of integers of different signs: 'const unsigned int' and 'const int' [-Werror,-Wsign-compare]
        return left == right;
               ~~~~ ^  ~~~~~
    /usr/local/include/boost/test/tools/old/impl.hpp:130:16: note: in instantiation of function template specialization 'boost::test_tools::tt_detail::equal_impl<unsigned int, int>' requested here
            return equal_impl( left, right );
                   ^
    /usr/local/include/boost/test/tools/old/impl.hpp:145:16: note: in instantiation of function template specialization 'boost::test_tools::tt_detail::equal_impl_frwd::call_impl<unsigned int, int>' requested here
            return call_impl( left, right, left_is_array() );
                   ^
    /usr/local/include/boost/test/tools/old/impl.hpp:92:50: note: in instantiation of function template specialization 'boost::test_tools::tt_detail::equal_impl_frwd::operator()<unsigned int, int>' requested here
    BOOST_PP_REPEAT( BOOST_TEST_MAX_PREDICATE_ARITY, IMPL_FRWD, _ )
                                                     ^
    /usr/local/include/boost/preprocessor/repetition/repeat.hpp:30:26: note: expanded from macro 'BOOST_PP_REPEAT'
                             ^
    /usr/local/include/boost/preprocessor/cat.hpp:22:32: note: expanded from macro 'BOOST_PP_CAT'
                                   ^
    /usr/local/include/boost/preprocessor/cat.hpp:29:34: note: expanded from macro 'BOOST_PP_CAT_I'
                                     ^
    <scratch space>:153:1: note: expanded from here
    BOOST_PP_REPEAT_1
    ^
    test/streams_tests.cpp:122:5: note: in instantiation of function template specialization 'boost::test_tools::tt_detail::check_frwd<boost::test_tools::tt_detail::equal_impl_frwd, unsigned int, int>' requested here
        BOOST_CHECK_EQUAL(varint, 54321);
        ^
    
    /usr/local/include/boost/test/tools/old/impl.hpp:107:17: error: comparison of integers of different signs: 'const unsigned long long' and 'const long' [-Werror,-Wsign-compare]
        return left == right;
               ~~~~ ^  ~~~~~
    /usr/local/include/boost/test/tools/old/impl.hpp:130:16: note: in instantiation of function template specialization 'boost::test_tools::tt_detail::equal_impl<unsigned long long, long>' requested here
            return equal_impl( left, right );
                   ^
    /usr/local/include/boost/test/tools/old/impl.hpp:145:16: note: in instantiation of function template specialization 'boost::test_tools::tt_detail::equal_impl_frwd::call_impl<unsigned long long, long>' requested here
            return call_impl( left, right, left_is_array() );
                   ^
    /usr/local/include/boost/test/tools/old/impl.hpp:92:50: note: in instantiation of function template specialization 'boost::test_tools::tt_detail::equal_impl_frwd::operator()<unsigned long long, long>' requested here
    BOOST_PP_REPEAT( BOOST_TEST_MAX_PREDICATE_ARITY, IMPL_FRWD, _ )
                                                     ^
    /usr/local/include/boost/preprocessor/repetition/repeat.hpp:30:26: note: expanded from macro 'BOOST_PP_REPEAT'
                             ^
    /usr/local/include/boost/preprocessor/cat.hpp:22:32: note: expanded from macro 'BOOST_PP_CAT'
                                   ^
    /usr/local/include/boost/preprocessor/cat.hpp:29:34: note: expanded from macro 'BOOST_PP_CAT_I'
                                     ^
    <scratch space>:161:1: note: expanded from here
    BOOST_PP_REPEAT_1
    ^
    test/serfloat_tests.cpp:41:5: note: in instantiation of function template specialization 'boost::test_tools::tt_detail::check_frwd<boost::test_tools::tt_detail::equal_impl_frwd, unsigned long long, long>' requested here
        BOOST_CHECK_EQUAL(TestDouble(std::numeric_limits<double>::infinity()), 0x7ff0000000000000);
        ^
    4e44f5bac4
  5. Empact force-pushed on Jun 9, 2021
  6. Empact commented at 4:42 pm on June 9, 2021: member

    Commented with my system specs here #19123 (comment)

    Rebased and minimized this change.

  7. theStack commented at 10:30 pm on June 11, 2021: member

    I can confirm that on my system (OpenBSD 6.9, clang 10.0.1) the same warnings appear on master and that this PR fixes them.

    ACK 4e44f5bac4481d49ac53c458dcc5ca48e8b28414

  8. practicalswift commented at 7:57 am on June 12, 2021: contributor
    Concept ACK
  9. fanquake merged this on Jul 9, 2021
  10. fanquake closed this on Jul 9, 2021

  11. Empact deleted the branch on Jul 9, 2021
  12. sidhujag referenced this in commit b07649d6f8 on Jul 10, 2021
  13. gwillen referenced this in commit 5b9fec6ef0 on Jun 1, 2022
  14. DrahtBot locked this on Aug 16, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-11-17 12:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me