basho / eleveldb

Erlang LevelDB API
262 stars 177 forks source link

Error in compiling (current elevel2.0), Freebsd 9.2 [JIRA: RIAK-2046] #124

Open Dryymoon opened 10 years ago

Dryymoon commented 10 years ago

c++ -Wall -O3 -fPIC -I /usr/FROBILL/ROOT_NEW/APPLICATION/deps/eleveldb/c_src/system/include -I. -I./include -fno-builtin-memcmp -D_REENTRANT -DOS_FREEBSD -DLEVELDB_PLATFORM_POSIX -DSNAPPY -O2 -g -DNDEBUG -fPIC -c port/port_posix.cc -o port/port_posix.o rm -f libleveldb.a ar -rs libleveldb.a db/builder.o db/c.o db/db_impl.o db/db_iter.o db/dbformat.o db/filename.o db/log_reader.o db/log_writer.o db/memtable.o db/repair.o db/table_cache.o db/version_edit.o db/version_set.o db/write_batch.o table/block.o table/block_builder.o table/filter_block.o table/format.o table/iterator.o table/merger.o table/table.o table/table_builder.o table/two_level_iterator.o util/arena.o util/bloom.o util/bloom2.o util/cache.o util/cache2.o util/coding.o util/comparator.o util/crc32c.o util/db_list.o util/env.o util/env_posix.o util/filter_policy.o util/flexcache.o util/hash.o util/histogram.o util/hot_threads.o util/logging.o util/murmurhash.o util/options.o util/perf_count.o util/status.o util/throttle.o port/port_posix.o ar: warning: creating libleveldb.a gmake[1]: Leaving directory `/usr/FROBILL/ROOT_NEW/APPLICATION/deps/eleveldb/c_src/leveldb' Compiled src/eleveldb_bump.erl Compiled src/eleveldb.erl Compiling /usr/FROBILL/ROOT_NEW/APPLICATION/deps/eleveldb/c_src/eleveldb.cc /usr/FROBILL/ROOT_NEW/APPLICATION/deps/eleveldb/c_src/eleveldb.cc: In function 'ERL_NIF_TERM parse_initoption(ErlNifEnv, ERL_NIF_TERM, EleveldbOptions&)': /usr/FROBILL/ROOT_NEW/APPLICATION/deps/eleveldb/c_src/eleveldb.cc:244: error: invalid conversion from 'sizet' to 'long unsigned int_' /usr/FROBILL/ROOT_NEW/APPLICATION/deps/eleveldb/c_src/eleveldb.cc:244: error: initializing argument 3 of 'int enif_getulong(ErlNifEnv, ERL_NIFTERM, long unsigned int)' /usr/FROBILL/ROOT_NEW/APPLICATION/deps/eleveldb/c_src/eleveldb.cc: In function 'ERL_NIF_TERM parse_openoption(ErlNifEnv, ERL_NIF_TERM, leveldb::Options&)': /usr/FROBILL/ROOT_NEW/APPLICATION/deps/eleveldb/c_src/eleveldb.cc:332: error: invalid conversion from 'sizet' to 'long unsigned int_' /usr/FROBILL/ROOT_NEW/APPLICATION/deps/eleveldb/c_src/eleveldb.cc:332: error: initializing argument 3 of 'int enif_getulong(ErlNifEnv, ERL_NIFTERM, long unsigned int)' ERROR: compile failed while processing /usr/FROBILL/ROOT_NEW/APPLICATION/deps/eleveldb: rebar_abort gmake: *\ [deps] Error 1

matthewvon commented 10 years ago

This a 32 bit platform?

Dryymoon commented 10 years ago

yes, 32 bit platform

ptribble commented 9 years ago

I'm seeing the same error on illumos (again, in 32-bits). As enif_get_ulong() will always require an unsigned long, why is memory_sz declared as a size_t? Looking at the usage of the result, it's not clear to me why it needs to be a size_t (and if it is, then maybe cast it when necessary).