google / google/farmhash

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

Open
#2 1 comment 0 reactions 0 assignees View on GitHub
auto-migrated Priority-Medium Type-Defect
Dominant language
C++
Stars
658
Forks
107
PR merge metrics
No merged PRs in 30d

Description

```
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(len) would do the trick.
```

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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.