Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation warnings with Clang #18

Open
shreyasbharath opened this issue Jun 26, 2018 · 0 comments
Open

Compilation warnings with Clang #18

shreyasbharath opened this issue Jun 26, 2018 · 0 comments

Comments

@shreyasbharath
Copy link

shreyasbharath commented Jun 26, 2018

A whole bunch of warnings pop up when compiling with Clang.

Can we fix these please?

picosha2.h:199:57: error: implicit conversion changes signedness: 'std::size_t' (aka 'unsigned int') to 'std::__1::__wrap_iter<unsigned char *>::difference_type' (aka 'int') [-Werror,-Wsign-conversion]
            detail::hash256_block(h_, buffer_.begin() + i,
                                                      ~ ^
picosha2.h:200:53: error: implicit conversion changes signedness: 'std::size_t' (aka 'unsigned int') to 'std::__1::__wrap_iter<unsigned char *>::difference_type' (aka 'int') [-Werror,-Wsign-conversion]
                                  buffer_.begin() + i + 64);
                                                  ~ ^
picosha2.h:202:58: error: implicit conversion changes signedness: 'std::size_t' (aka 'unsigned int') to 'std::__1::__wrap_iter<unsigned char *>::difference_type' (aka 'int') [-Werror,-Wsign-conversion]
        buffer_.erase(buffer_.begin(), buffer_.begin() + i);
                                                       ~ ^
picosha2.h:301:32: error: implicit conversion changes signedness: 'int' to 'std::__1::vector<unsigned char, std::__1::allocator<unsigned char> >::size_type' (aka 'unsigned int') [-Werror,-Wsign-conversion]
    std::vector<byte_t> buffer(buffer_size);
                        ~~~~~~ ^~~~~~~~~~~
picosha2.h:199:57: error: implicit conversion changes signedness: 'std::size_t' (aka 'unsigned int') to 'std::__1::__wrap_iter<unsigned char *>::difference_type' (aka 'int') [-Werror,-Wsign-conversion]
            detail::hash256_block(h_, buffer_.begin() + i,
                                                      ~ ^
picosha2.h:293:12: note: in instantiation of function template specialization 'picosha2::hash256_one_by_one::process<std::__1::__wrap_iter<const char *> >' requested here
    hasher.process(first, last);
           ^
picosha2.h:323:21: note: in instantiation of function template specialization 'picosha2::impl::hash256_impl<std::__1::__wrap_iter<const char *>, unsigned char *>' requested here
    picosha2::impl::hash256_impl(
                    ^
picosha2.h:346:5: note: in instantiation of function template specialization 'picosha2::hash256<std::__1::__wrap_iter<const char *>, unsigned char *>' requested here
    hash256(first, last, hashed, hashed + k_digest_size);
    ^
picosha2.h:360:5: note: in instantiation of function template specialization 'picosha2::hash256_hex_string<std::__1::__wrap_iter<const char *> >' requested here
    hash256_hex_string(src.begin(), src.end(), hex_str);
    ^
picosha2.h:200:53: error: implicit conversion changes signedness: 'std::size_t' (aka 'unsigned int') to 'std::__1::__wrap_iter<unsigned char *>::difference_type' (aka 'int') [-Werror,-Wsign-conversion]
                                  buffer_.begin() + i + 64);
                                                  ~ ^
picosha2.h:202:58: error: implicit conversion changes signedness: 'std::size_t' (aka 'unsigned int') to 'std::__1::__wrap_iter<unsigned char *>::difference_type' (aka 'int') [-Werror,-Wsign-conversion]
        buffer_.erase(buffer_.begin(), buffer_.begin() + i);
                                                       ~ ^
picosha2.h:98:59: error: implicit conversion changes signedness: 'unsigned int' to 'std::__1::__wrap_iter<unsigned char *>::difference_type' (aka 'int') [-Werror,-Wsign-conversion]
        w[i] = (static_cast<word_t>(mask_8bit(*(first + i * 4))) << 24) |
                                                      ~ ~~^~~
picosha2.h:199:21: note: in instantiation of function template specialization 'picosha2::detail::hash256_block<unsigned long *, std::__1::__wrap_iter<unsigned char *> >' requested here
            detail::hash256_block(h_, buffer_.begin() + i,
                    ^
picosha2.h:293:12: note: in instantiation of function template specialization 'picosha2::hash256_one_by_one::process<std::__1::__wrap_iter<const char *> >' requested here
    hasher.process(first, last);
           ^
picosha2.h:323:21: note: in instantiation of function template specialization 'picosha2::impl::hash256_impl<std::__1::__wrap_iter<const char *>, unsigned char *>' requested here
    picosha2::impl::hash256_impl(
                    ^
picosha2.h:346:5: note: in instantiation of function template specialization 'picosha2::hash256<std::__1::__wrap_iter<const char *>, unsigned char *>' requested here
    hash256(first, last, hashed, hashed + k_digest_size);
    ^
picosha2.h:360:5: note: in instantiation of function template specialization 'picosha2::hash256_hex_string<std::__1::__wrap_iter<const char *> >' requested here
    hash256_hex_string(src.begin(), src.end(), hex_str);
    ^
picosha2.h:99:59: error: implicit conversion changes signedness: 'unsigned int' to 'std::__1::__wrap_iter<unsigned char *>::difference_type' (aka 'int') [-Werror,-Wsign-conversion]
               (static_cast<word_t>(mask_8bit(*(first + i * 4 + 1))) << 16) |
                                                      ~ ~~^~~
picosha2.h:100:59: error: implicit conversion changes signedness: 'unsigned int' to 'std::__1::__wrap_iter<unsigned char *>::difference_type' (aka 'int') [-Werror,-Wsign-conversion]
               (static_cast<word_t>(mask_8bit(*(first + i * 4 + 2))) << 8) |
                                                      ~ ~~^~~
picosha2.h:101:59: error: implicit conversion changes signedness: 'unsigned int' to 'std::__1::__wrap_iter<unsigned char *>::difference_type' (aka 'int') [-Werror,-Wsign-conversion]
               (static_cast<word_t>(mask_8bit(*(first + i * 4 + 3))));
                                                      ~ ~~^~~
picosha2.h:199:57: error: implicit conversion changes signedness: 'std::size_t' (aka 'unsigned int') to 'std::__1::__wrap_iter<unsigned char *>::difference_type' (aka 'int') [-Werror,-Wsign-conversion]
            detail::hash256_block(h_, buffer_.begin() + i,
                                                      ~ ^
picosha2.h:293:12: note: in instantiation of function template specialization 'picosha2::hash256_one_by_one::process<std::__1::__wrap_iter<unsigned char *> >' requested here
    hasher.process(first, last);
           ^
picosha2.h:323:21: note: in instantiation of function template specialization 'picosha2::impl::hash256_impl<std::__1::__wrap_iter<unsigned char *>, std::__1::__wrap_iter<unsigned char *> >' requested here
    picosha2::impl::hash256_impl(
                    ^
blah.h:78:13: note: in instantiation of function template specialization 'picosha2::hash256<std::__1::__wrap_iter<unsigned char *>, std::__1::__wrap_iter<unsigned char *> >' requested here
  picosha2::hash256(image.begin(), image.end(), hash.begin(), hash.end());
            ^
picosha2.h:200:53: error: implicit conversion changes signedness: 'std::size_t' (aka 'unsigned int') to 'std::__1::__wrap_iter<unsigned char *>::difference_type' (aka 'int') [-Werror,-Wsign-conversion]
                                  buffer_.begin() + i + 64);
                                                  ~ ^
picosha2.h:202:58: error: implicit conversion changes signedness: 'std::size_t' (aka 'unsigned int') to 'std::__1::__wrap_iter<unsigned char *>::difference_type' (aka 'int') [-Werror,-Wsign-conversion]
        buffer_.erase(buffer_.begin(), buffer_.begin() + i);
                                                       ~ ^
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant