Commit from Per:
Line 3997: */ PIKEFUN float|int(0..0) `()(void|float|int(0..0) sleep_time) { - struct timeval timeout; /* Got bogus gcc warning on timeout.tv_usec. */ + struct timeval timeout; /* Got correct gcc warning on timeout.tv_usec. */
if (sleep_time && sleep_time->type == PIKE_T_FLOAT) { timeout.tv_sec = (long) floor (sleep_time->u.float_number);
No, the warning is indeed bogus since the tv_usec field isn't relevant when the tv_sec field is -1. The added assignment is completely unnecessary work.
Ah, no, it's not any more. But valgrind also warns, in backend_once_setup.
I guess the problem is that gcc generates code that loads and does things with both members of the struct at once, even when tv_sec == -1
pike-devel@lists.lysator.liu.se