boostorg / container_hash

Generic hash function for STL style unordered containers
https://boost.org/libs/container_hash
29 stars 39 forks source link

Warning about conversion to unsigned int from int #25

Closed joaquintides closed 1 year ago

joaquintides commented 1 year ago

GCC 4.6 complains that:

../boost/container_hash/hash.hpp: In function 'std::size_t boost::hash_detail::hash_value_signed(T)':
../boost/container_hash/hash.hpp:273:81: error: conversion to 'unsigned int' from 'int' may change the sign of the result [-Werror=sign-conversion]
../boost/container_hash/hash.hpp: In function 'std::size_t boost::hash_detail::hash_value_unsigned(T)':
../boost/container_hash/hash.hpp:294:81: error: conversion to 'unsigned int' from 'int' may change the sign of the result [-Werror=sign-conversion]

I've taken a look at the develop branch and saw no trace of a hash_value_signed function, so I wonder if the branch was meant to be merged to master before 1.80 (probably too late now).

pdimov commented 1 year ago

No, it wasn't meant to. It's a fairly disruptive change, so I want to leave it on develop for a while.

pdimov commented 1 year ago

The develop branch has been merged now, so this should be resolved.