On macOS Sierra (OSX 10.12.1):
$ ./configure --with-pydebug && make
[... lots of output omitted ...]
gcc -c -Wno-unused-result -Wsign-compare -g -O0 -Wall -Wstrict-prototypes -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -I. -I./Include -DPy_BUILD_CORE -o Python/random.o Python/random.c
Python/random.c:97:19: warning: implicit declaration of function 'getentropy' is
invalid in C99 [-Wimplicit-function-declaration]
res = getentropy(buffer, len);
^
1 warning generated.
This is because OSX 10.12.1 has getentropy() but does not have
getrandom(). You can see this in pyconfig.h:
/* Define to 1 if you have the `getentropy' function. */
#define HAVE_GETENTROPY 1
/* Define to 1 if the getrandom() function is available */
/* #undef HAVE_GETRANDOM */
and this means that in Python/random.c the header <sys/random.h> is
not included:
# ifdef HAVE_GETRANDOM
# include <sys/random.h>
# elif defined(HAVE_GETRANDOM_SYSCALL)
# include <sys/syscall.h>
# endif
It's necessary include <sys/random.h> if either HAVE_GETRANDOM or
HAVE_GETENTROPY is defined. |