On Wed, 31 Mar 2021, Liu Hao wrote:

在 2021/3/31 下午7:46, Martin Storsjö 写道:

Hmm, if MSVC defaults to a 64 bit time_t in 32 bit mode these days, I think we should too, for UCRT. (Technically I guess it's an ABI break, but I'd be quite comfortable doing it, while I'd be less comfortable changing any defaults for msvcrt.dll targets.)



It is not only 'these days'. Even with VS2013, when CL.EXE is invoked from command line, the default size of `time_t` will be 8 bytes, no matter whether to target x86 or x64, unless `_USE_32BIT_TIME_T` is defined, in which case it is 4 bytes.


```c
/* Run these commands in 'VS2013 x86 Native Tools Command Prompt':
*
*   cl test.c && test.exe
*   cl /D_USE_32BIT_TIME_T test.c && test.exe
**/

#include <stdio.h>
#include <time.h>

int main(void)
 {
   printf("sizeof(time_t) = %d\n", (int)sizeof(time_t));
 }
```

Fair point, it's probably been doing the sensible thing for quite a while now already. But anyway, we probably shouldn't be changing the defaults for msvcrt.dll targets, but for UCRT I think we are much more excused to be changing things.

// Martin

_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to