Hi all,
I've stumbled across an issue with gettimeofday() returning an incorrect
value with mingw-w64. A simple code sample:
#include <stdio.h>
#include <sys/time.h>
int main (void)
{
struct timeval timer;
int retval;
retval= gettimeofday(&timer,NULL);
fprintf(stderr, "retval: %d\n", retval);
fprintf(stderr, "now: %ld\n", time(0));
fprintf(stderr, "now: %ld\n", timer.tv_sec);
return(0);
}
When compiled using -
regular mingw (correct output)
Patrick galbra...@win-7a3e68a2d98 ~/dev/stuff
$ gcc -o mtime mtime.c
Patrick galbra...@win-7a3e68a2d98 ~/dev/stuff
$ ./mtime.exe
retval: 0
now: 1271722468
now: 1271722468
mingw-w64:
Patrick galbra...@win-7a3e68a2d98 ~/dev/stuff
$ /c/mingw/bin/x86_64-w64-mingw32-gcc -o mtime mtime.c
Patrick galbra...@win-7a3e68a2d98 ~/dev/stuff
$ ./mtime.exe
retval: 0
now: 1271722480
now: 31293027
Are there any known issues with gettimeofday() with mingw-w64?
Thanks!
Patrick
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public