From: Sebastian Pipping Date: Mon, 24 Jul 2017 22:54:33 +0000 (+0200) Subject: Address warning about unused gather_time_entropy (#84) X-Git-Tag: R_2_2_3~20 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9a1ede8d14fd13985f93a7dc4deeaccd3ae13ba8;p=libexpat Address warning about unused gather_time_entropy (#84) .. with HAVE_ARC4RANDOM and/or HAVE_ARC4RANDOM_BUF defined --- diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c index 4f264a50..3201b2a8 100644 --- a/expat/lib/xmlparse.c +++ b/expat/lib/xmlparse.c @@ -839,6 +839,8 @@ writeRandomBytes_RtlGenRandom(void * target, size_t count) { #endif /* _WIN32 */ +#if ! defined(HAVE_ARC4RANDOM_BUF) && ! defined(HAVE_ARC4RANDOM) + static unsigned long gather_time_entropy(void) { @@ -863,6 +865,9 @@ gather_time_entropy(void) #endif } +#endif /* ! defined(HAVE_ARC4RANDOM_BUF) && ! defined(HAVE_ARC4RANDOM) */ + + static unsigned long ENTROPY_DEBUG(const char * label, unsigned long entropy) { const char * const EXPAT_ENTROPY_DEBUG = getenv("EXPAT_ENTROPY_DEBUG"); @@ -881,7 +886,6 @@ generate_hash_secret_salt(XML_Parser parser) unsigned long entropy; (void)parser; #if defined(HAVE_ARC4RANDOM_BUF) - (void)gather_time_entropy; arc4random_buf(&entropy, sizeof(entropy)); return ENTROPY_DEBUG("arc4random_buf", entropy); #elif defined(HAVE_ARC4RANDOM)