[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [Libevent-users] Found a warning in libevent 2.0.21



I found a really simple solution!

#if defined(_EVENT_HAVE_ARC4RANDOM_BUF)
	/* OSX 10.7 introducd arc4random_buf, so if you build your program
	 * there, you'll get surprised when older versions of OSX fail to run.
	 * To solve this, we can check whether the function pointer is set,
	 * and fall back otherwise.  (OSX does this using some linker
	 * trickery.)
	 */
        {
            void* tptr = (void*)arc4random_buf;
            if (tptr != NULL) {
		return arc4random_buf(buf, n);
            }
	}
#endif

Silences the warning just fine.

On Sep 16, 2013, at 10:51 AM, Nick Mathewson <nickm@xxxxxxxxxxxxx> wrote:

> On Mon, Sep 16, 2013 at 1:17 PM, Ralph Castain <rhc@xxxxxxxxxxxx> wrote:
> [...]
>> I'm unaware of a way to turn the warning off for one line - of course, we could turn if off for all of libevent, but that seems a tad extreme and may not be a good idea.
>> 
>> Only other option I can think of would be to use dlsym to check for the existence of the function - would that be an acceptable solution?
> 
> I hope so!
> 
> For what it's worth, Greg Hazel introduced the current behavior with
> bff5f9407341030c7, so it might be worth asking him what he thinks
> and/or what environment to test this in.  Greg?
> 
> -- 
> Nick
> ***********************************************************************
> To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
> unsubscribe libevent-users    in the body.

***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users    in the body.