Post
Topic
Board Project Development
Re: [ANN] cbitcoin 2.0 - A Bitcoin Library in C
by
GMD1987
on 04/02/2013, 18:19:03 UTC
MatthewLM,
On Linux crunchbang 3.2.0-0.bpo.4-686-pae #1 SMP Debian 3.2.35-2~bpo60+1 i686 GNU/Linux, cloned and ran ./configure && make test.  Error on openssl libs, apt-get installed libssl-dev zlib1g-dev, tried again but got the following for dependencies/random/CBRand.c
dependencies/random/CBRand.c: In function ‘CBNewSecureRandomGenerator’:
dependencies/random/CBRand.c:33: error: cast from pointer to integer of different size
dependencies/random/CBRand.c: In function ‘CBSecureRandomSeed’:
dependencies/random/CBRand.c:38: error: cast to pointer from integer of different size
dependencies/random/CBRand.c: In function ‘CBRandomSeed’:
dependencies/random/CBRand.c:41: error: cast to pointer from integer of different size
dependencies/random/CBRand.c:42: error: cast to pointer from integer of different size
dependencies/random/CBRand.c: In function ‘CBSecureRandomInteger’:
dependencies/random/CBRand.c:45: error: cast to pointer from integer of different size
dependencies/random/CBRand.c:45: error: cast to pointer from integer of different size
dependencies/random/CBRand.c:47: error: cast to pointer from integer of different size
dependencies/random/CBRand.c: In function ‘CBFreeSecureRandomGenerator’:
dependencies/random/CBRand.c:51: error: cast to pointer from integer of different size

Looking at the code, uint64_t was used (and designed for this sort of error, no?)
bool CBNewSecureRandomGenerator(uint64_t * gen){
        *gen = (uint64_t)malloc(32);
        return *gen;
}

Do you know what's going on here?  I'm pretty sure the cast it's referring to is in the assignment.  I think this was initially a warning converted to an error and just turning off pedantic would solve it but would be antithetical to a make test  Cheesy