From 7de493fc023047faf084a3c4ff4303dfcd61407a Mon Sep 17 00:00:00 2001 From: Ralph Castain Date: Wed, 18 Sep 2013 02:03:01 +0000 Subject: [PATCH] Silence a warning about an address that can never be NULL - libevent needs to deal with the situation where the user may have compiled the code on a system where this function is present, but executes it on one where it isn't. Thus, a compile-time test isn't adequate. Pushed upstream. cmr:v1.7.3:reviewer=jsquyres This commit was SVN r29201. --- opal/mca/event/libevent2021/libevent/evutil_rand.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/opal/mca/event/libevent2021/libevent/evutil_rand.c b/opal/mca/event/libevent2021/libevent/evutil_rand.c index 284e230e9e..750b2b50e6 100644 --- a/opal/mca/event/libevent2021/libevent/evutil_rand.c +++ b/opal/mca/event/libevent2021/libevent/evutil_rand.c @@ -70,8 +70,11 @@ ev_arc4random_buf(void *buf, size_t n) * and fall back otherwise. (OSX does this using some linker * trickery.) */ - if (arc4random_buf != NULL) { + { + void* tptr = (void*)arc4random_buf; + if (tptr != NULL) { return arc4random_buf(buf, n); + } } #endif /* Make sure that we start out with b at a 4-byte alignment; plenty