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

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



Hi Nick

Sorry for delayed response - been a little hectic, and had to think about this a bit. I gather your concern is that (a) someone builds libevent on a 10.7 or above Mac, and then (b) someone executes that binary on a pre-10.7 Mac, and therefore arc4random_buf is not found? If so, I would think you'd generate a loader failure before you could check for a NULL pointer - yes?

Problem is that I get this warning on OSX as well as on Linux, so confining it to OSX wouldn't remove it. Only thing I can think of (assuming the loader failure doesn't occur) is to have a runtime check of what OSX level we are on, and then protect the call to arc4random_buf using that instead of checking for a NULL pointer.


On Sep 6, 2013, at 6:43 PM, Nick Mathewson <nickm@xxxxxxxxxxxxx> wrote:

> On Thu, Aug 29, 2013 at 4:47 PM, Ralph Castain <rhc@xxxxxxxxxxxx> wrote:
>> Just updated to gcc 4.7.3 and got this warning
>> 
>> evutil_rand.c: In function 'ev_arc4random_buf':
>> evutil_rand.c:73:21: warning: the comparison will always evaluate as 'true' for the address of 'arc4random_buf' will never be NULL [-Waddress]
>> 
>> 
> 
> Hm.  The problem is, that check is necessary on some platforms.  I
> wonder if we can write it in such a way that the compiler doesn't
> complain?  (See the comment.)
> 
> I guess we could make the check there OSX-only?
> 
> yrs,
> -- 
> 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.