waywardgeek / infnoise

The world's easiest TRNG to get right
Creative Commons Zero v1.0 Universal
723 stars 99 forks source link

Cannot compile on macOS 13.2.1 with XCode 14.2 #97

Open jms1voalte opened 1 year ago

jms1voalte commented 1 year ago

Compiling from commit 8edb00bb on macOS 13.2.1 with XCode 14.2 fails with the following message:

infnoise.c:63:60: error: parameter 'entropy' set but not used [-Werror,-Wunused-but-set-parameter]
bool outputBytes(uint8_t *bytes, uint32_t length, uint32_t entropy, bool writeDevRandom, const char **message) {
                                                           ^
1 error generated.
make: *** [Makefile.macos:28: infnoise.o] Error 1

I see line 92 says entropy = 0; // suppress warning, but this looks like it's just trading one warning for another.

I was able to make it compile by adding -Wno-unused-but-set-parameter to the CFLAGS value in Makefile.macos, and the resulting executable does seem to work (i.e. sudo ./infnoise | dd status=none bs=256 count=1 | hexdump -C produces different random-looking output every time). However, I'm not sure if this is the best way to handle things.