Skip to content

warning: implicit conversion changes signedness: 'const std::ptrdiff_t' (aka 'const long') to 'unsigned long' [-Wsign-conversion] #237

Open
@yurivict

Description

@yurivict

clang-10 prints this:

In file included from include/xtl/xspan.hpp:13:
include/xtl/xspan_impl.hpp:312:35: warning: implicit conversion changes signedness: 'const std::ptrdiff_t' (aka 'const long') to 'unsigned long' [-Wsign-conversion]
        TCB_SPAN_EXPECT(extent == dynamic_extent || count == extent);
                               ~~ ^~~~~~~~~~~~~~
include/xtl/xspan_impl.hpp:91:5: note: expanded from macro 'TCB_SPAN_EXPECT'
    cond ? (void) 0 : contract_violation("Expected " TCB_SPAN_STRINGIFY(cond))
    ^~~~
include/xtl/xdynamic_bitset.hpp:249:22: note: in instantiation of member function 'tcb::span<unsigned long, -1>::span' requested here
        : base_class(storage_type(ptr, detail_bitset::integer_ceil(size, base_class::s_bits_per_block)), size)
                     ^
test/test_xdynamic_bitset.cpp:244:21: note: in instantiation of member function 'xtl::xdynamic_bitset_view<unsigned long>::xdynamic_bitset_view' requested here
        bitset_view b(bs.data(), 80);
                    ^
1 warning generated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions