
21 Apr
2008
21 Apr
'08
7:42 p.m.
Juergen Hunold: ...
I've got a small fix attached which (hopefully) initialises "rqtp" completely in the initialiser list and removes the (hopefully) redundant assignments.
else { - struct timespec rqtp = { 0 }; + struct timespec rqtp = { 0, 1000 }; - rqtp.tv_sec = 0; - rqtp.tv_nsec = 1000; - nanosleep( &rqtp, 0 ); } POSIX says that struct timespec has at least the members tv_sec and tv_nsec, but it doesn't guarantee their order or placement. Does struct timespec rqtp = {}; still emit the warnings?