From: Eli Z. <el...@gn...> - 2013-09-20 07:36:40
|
It seems MinGW runtime 4.x switched to a 64-bit type for time_t by default. However, 'struct timeval' still uses 'long tv_sec', which is a 32-bit type, and is thus incompatible with Posix, whose requirement is that tv_sec be at least as wide as time_t. This causes gnulib tests in sys_time_h.m4 to fail and decide that 'struct timeval' needs to be replaced by a Posix-compliant definition. See, for example, this discussion on emacs-devel: http://lists.gnu.org/archive/html/emacs-devel/2013-09/msg00286.html and especially this message: http://lists.gnu.org/archive/html/emacs-devel/2013-09/msg00361.html I think I understand the difficulty in fixing this issue, given that 'struct timeval' is used by Windows APIs on which MinGW has no control. But if this is not fixed, every project that uses gnulib (and there are more and more of them lately) will simply replace 'struct timeval' with incompatible definition anyway, which cannot be good. So I think the MinGW runtime should do something to make this problem go away. E.g., some wrappers around functions that use the structure, or something. In any case, even if nothing will be done, I think it's important that MinGW users be aware of this gotcha. |