From 9a1ede8d14fd13985f93a7dc4deeaccd3ae13ba8 Mon Sep 17 00:00:00 2001 From: Sebastian Pipping Date: Tue, 25 Jul 2017 00:54:33 +0200 Subject: [PATCH] Address warning about unused gather_time_entropy (#84) .. with HAVE_ARC4RANDOM and/or HAVE_ARC4RANDOM_BUF defined --- expat/lib/xmlparse.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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) -- 2.49.0