RoestVrijStaal / farmhash

Automatically exported from code.google.com/p/farmhash

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Compiler warnings when 64-bit size_t is squashed to 32-bits

GoogleCodeExporter opened this issue · comments

What steps will reproduce the problem?
1. Try compiling farmhash on a 64-bit Mac using Xcode 6.x

What is the expected output? What do you see instead?
I expect it to compile clean. Instead I get a ton of warnings:
farmhash.cc:995:26: Implicit conversion loses integer precision: 'size_t' (aka 
'unsigned long') to 'uint32_t' (aka 'unsigned int')

What version of the product are you using? On what operating system?
farmhash-1.1.0

Please provide any additional information below.

Not that anybody would try to hash 4+ gigabytes of data, but if they do, will 
it still work?

If you feel that losing precision is intentional, then a bunch of 
static_cast<uint32_t>(len) would do the trick.

Original issue reported on code.google.com by daryll...@gmail.com on 30 Jun 2015 at 5:56