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

db/version_set.cc:60: error: integer constant is too large for ‘long’ type #87

Closed
BillBarnhill opened this issue Jul 14, 2013 · 2 comments

Comments

@BillBarnhill
Copy link

Environment

  • Mac OS X 10.7.5
  • Using Riak source from http://s3.amazonaws.com/downloads.basho.com/riak/1.4/1.4.0/riak-1.4.0.tar.gz - fetched on 14 JUL 2013
  • Erlang R15B01 (erts-5.9.1) [source] [smp:4:4] [async-threads:0] [hipe] [kernel-poll:false]
  • $ cc -v
    • Using built-in specs.
    • Target: i686-apple-darwin11
    • Configured with:
      • /private/var/tmp/llvmgcc42/llvmgcc42-2336.1~22/src/configure -
      • -disable-checking
      • --enable-werror
      • --prefix=/Developer/usr/llvm-gcc-4.2
      • --mandir=/share/man
      • --enable-languages=c,objc,c++,obj-c++
      • --program-prefix=llvm-
      • --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/
      • --with-slibdir=/usr/lib
      • --build=i686-apple-darwin11
      • --enable-llvm=/private/var/tmp/llvmgcc42/llvmgcc42-2336.1~22/dst-llvmCore/Developer/usr/local
      • --program-prefix=i686-apple-darwin11-
      • --host=x86_64-apple-darwin11
      • --target=i686-apple-darwin11
      • --with-gxx-include-dir=/usr/include/c++/4.2.1
    • Thread model: posix
    • gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00)

Expected behavior

All deps build clean.

Observed behavior

The following error emitted when building eleveldb/leveldb dep:

db/version_set.cc:59: warning: this decimal constant is unsigned only in ISO C90
db/version_set.cc:59: warning: this decimal constant is unsigned only in ISO C90
db/version_set.cc:60: error: integer constant is too large for ‘long’ type
db/version_set.cc:60: error: integer constant is too large for ‘long’ type
db/version_set.cc:61: error: integer constant is too large for ‘long’ type
db/version_set.cc:61: error: integer constant is too large for ‘long’ type
db/version_set.cc:62: error: integer constant is too large for ‘long’ type
db/version_set.cc:62: error: integer constant is too large for ‘long’ type
table/filter_block.cc: In member function ‘bool     leveldb::FilterBlockReader::KeyMayMatch(uint64_t, const leveldb::Slice&)’:
table/filter_block.cc:112: warning: comparison between signed and unsigned integer expressions
util/env_posix.cc: In constructor ‘leveldb::<unnamed>::PosixEnv::PosixEnv()’:
util/env_posix.cc:936: warning: unused variable ‘ts’
make[1]: *** [libleveldb.dylib.1.9] Error 1
ERROR: Command [compile] failed!

Fix

Add ULL suffix to the appropriate constants at https://github.com/basho/leveldb/blob/master/db/version_set.cc#L55

Result

Builds, though there are still some warnings.

@fgallaire
Copy link
Contributor

Same bug on Centos Linux 6 64 bits with GCC 4.1.2 (Red Hat 4.1.2-54).
Why Basho doesn't fix that ?

@matthewvon
Copy link
Contributor

fixed in pul request 96

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants