Author gdr@garethrees.org
Recipients gdr@garethrees.org, ned.deily, ronaldoussoren
Date 2016-11-12.19:30:20
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1478979020.94.0.0997412321445.issue28676@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2016-11-12 19:30:21gdr@garethrees.orgsetrecipients: + gdr@garethrees.org, ronaldoussoren, ned.deily
2016-11-12 19:30:20gdr@garethrees.orgsetmessageid: <1478979020.94.0.0997412321445.issue28676@psf.upfronthosting.co.za>
2016-11-12 19:30:20gdr@garethrees.orglinkissue28676 messages
2016-11-12 19:30:20gdr@garethrees.orgcreate