gul-cpp / gul14

General Utility Library for C++14
https://gul14.info/
GNU Lesser General Public License v2.1
2 stars 1 forks source link

Clang warnings generated on Darwin #65

Closed alt-graph closed 9 months ago

alt-graph commented 9 months ago
In file included from ../src/trim.cc:24:
In file included from ../include/gul14/trim.h:28:
In file included from ../include/gul14/string_util.h:31:
../include/gul14/string_view.h:335:47: warning: operand of ? changes signedness: 'typename iterator_traits<const char *>::difference_type' (aka 'long') to 'unsigned long' [-Wsign-conversion]
        return iter == this->cend () ? npos : std::distance ( this->cbegin (), iter );
        ~~~~~~                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/trim.cc:36:27: note: in instantiation of member function 'gul14::basic_string_view<char>::find_first_not_of' requested here
    const auto lpos = str.find_first_not_of(ws_chars);
                          ^
In file included from ../src/trim.cc:24:
In file included from ../include/gul14/trim.h:28:
In file included from ../include/gul14/string_util.h:31:
../include/gul14/string_view.h:351:72: warning: implicit conversion changes signedness: 'gul14::basic_string_view::size_type' (aka 'unsigned long') to 'std::reverse_iterator<const char *>::difference_type' (aka 'long') [-Wsign-conversion]
        const_reverse_iterator iter = find_not_of ( this->crbegin () + pos, this->crend (), s );
                                                                     ~ ^~~
../src/trim.cc:41:27: note: in instantiation of member function 'gul14::basic_string_view<char>::find_last_not_of' requested here
    const auto rpos = str.find_last_not_of(ws_chars);
                          ^
In file included from ../src/trim.cc:24:
In file included from ../include/gul14/trim.h:28:
In file included from ../include/gul14/string_util.h:31:
../include/gul14/string_view.h:365:27: warning: implicit conversion changes signedness: 'typename iterator_traits<reverse_iterator<const char *>>::difference_type' (aka 'long') to 'unsigned long' [-Wsign-conversion]
        return len_ - 1 - std::distance ( first, last );
                        ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../include/gul14/string_view.h:352:48: note: in instantiation of function template specialization 'gul14::basic_string_view<char>::reverse_distance<std::reverse_iterator<const char *>>' requested here
        return iter == this->crend () ? npos : reverse_distance ( this->crbegin (), iter );
                                               ^
3 warnings generated.
Finii commented 9 months ago

You gonna fix this or I can jump in right now, because all other waiting stuff repells me ;-)