This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [v3] Fix hash_prime_size_policy_imp for 64-bit machines


Jonathan Lennox wrote:

+ /* 30 */ (unsigned long)8589934583ull,
+ /* 31 */ (unsigned long)17179869143ull,
+ /* 32 */ (unsigned long)34359738337ull,


Does this work if sizeof(unsigned long) < sizeof(std::size_t), e.g. 32-bit
long and 64-bit size_t?  I don't know if that's a supported configuration,
but it seems like this could be avoided by making just making this cast to
std::size_t in general.

Yes, I agree a cast to size_t is better, I will do the change. The problem ultimately is due to the fact that this code is adapted from tr1::hashatable where there are only unsigned longs involved.

Paolo.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]