libev Digest, Vol 40, Issue 5

Didier Spezia didier.06 at gmail.com
Wed Feb 16 20:07:07 CET 2011


Hi Marc,

the introduction of function ev_timeout_to_ms to get rid
of the dependency on ceil results in a conversion warning
with old versions of GCC (compiling in C++ mode).

src/libev/ev.c: In function `int ev_timeout_to_ms(ev_tstamp)':
src/libev/ev.c:824: warning: converting to `int' from `ev_tstamp'

(tested with GCC 3.4.6, default warning options)

The c++ front-end of GCC 4.3.2 seems to be more permissive
regarding double to int conversions and does not generate
any warning.

Adding an explicit cast removes the warning in all cases.
  int ms = (int)( timeout * 1000. + .999999 );

Regards,
Didier.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.schmorp.de/pipermail/libev/attachments/20110216/a35818e4/attachment.html>


More information about the libev mailing list