{"thread":{"id":"37023","subject":"trace.c: struct timeval tv not portable","startedAt":"2014-06-29T06:53:44Z","lastAt":"2014-06-29T06:53:44Z","messageCount":1,"participants":["Torsten Bögershausen"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"245151","messageId":"53AFB7F8.7070701@web.de","threadId":"37023","inReplyTo":null,"subject":"trace.c: struct timeval tv not portable","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2014-06-29T06:53:44Z","receivedAt":"2014-06-29T06:53:44Z","isPatch":false,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"\nThe following printout gives a warning:\n(trace.c, arounf line 105)\n\tstrbuf_addf(buf, \"%02d:%02d:%02d.%06ld \", tm.tm_hour, tm.tm_min,\n\t\t    tm.tm_sec, tv.tv_usec);\ntrace.c:105: warning: format ‘%06ld’ expects type ‘long int’, but argument 6 has type ‘__darwin_suseconds_t’\n\n\nA format string of  \"%06ld\" for is not always good for tv.tv_usec\n\nhttp://pubs.opengroup.org/onlinepubs/009695399/basedefs/sys/time.h.html\n\nA better solution would be:\n\n\tstrbuf_addf(buf, \"%02d:%02d:%02d.%06ld \", tm.tm_hour, tm.tm_min,\n\t\t    tm.tm_sec, (long int)tv.tv_usec);\n"}]}