hyperboria / bugs

Peer-to-peer IPv6 networking, secure and near-zero-conf.
153 stars 17 forks source link

error: static declaration of 'getentropy' follows non-static declaration #175

Open yurivict opened 6 years ago

yurivict commented 6 years ago

Getting this error with version 20.1 on FreeBSD 12:

crypto/random/seed/GetEntropyRandomSeed.c:28:12: error: static declaration of 'getentropy' follows non-static declaration
static int getentropy(void *buf, size_t buflen)
           ^
/usr/include/unistd.h:509:5: note: previous declaration is here
int getentropy(void *, size_t);
    ^
kpcyrd commented 6 years ago

@yurivict interesting, it seems FreeBSD has getrandom, which enabled GetEntropyRandomSeed.c together with the getentropy shim for linux, which is already defined in FreeBSD.

If you just want to fix the build, disable the getentropy declaration in crypto/random/seed/GetEntropyRandomSeed.c, I'm going to submit a PR that resolves this problem upstream.

kpcyrd commented 6 years ago

@yurivict could you try if this patch works for you? https://github.com/cjdelisle/cjdns/pull/1159