I am working on debugging time-related test failures in perl, when built
with i686 clang against mingw-w64 configured for ucrt.
https://github.com/msys2/MINGW-packages/issues/9178
The first test I debugged showed that it appears that time_t is 32-bits,
even though I expected it to be 64-bit due to _mingw.h having:
#if defined (_WIN32) && !defined (_WIN64) && !defined
(__MINGW_USE_VC2005_COMPAT) && !defined (_UCRT)
#ifndef _USE_32BIT_TIME_T
#define _USE_32BIT_TIME_T
#endif
#endif
However, some investigation shows this define is being defined despite
using _UCRT. Perhaps this define is too soon, before corecrt.h is
included to define _UCRT?
Also, this test turned up what appears to be a bug in the UCRT path:
#include <time.h>
#include <stdio.h>
int main(int argc, char ** argv)
{
time_t t = 2147483647;
printf("%zu\n", sizeof(time_t));
printf("%p\n", localtime(&t));
return 0;
}
In 32-bit msvcrt this prints
4
001f0d68
But in 32-bit UCRT this prints
4
00000000
That returning NULL caused this perl test to fail. I imagine this
wouldn't happen if not using 32-bit time_t, so it may be better to get
that working.
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public