On Saturday 22 March 2025 15:35:48 Lasse Collin wrote:
> Things I noticed about your patches but I didn't make any changes:
> 
>   - With MSVCRT, _stat32 sets timestamps to -1 if the time doesn't fit
>     into 32-bit time_t. The 32i64 wrappers truncate the timestamps
>     instead. Maybe this doesn't matter, but I mention it in case you
>     think it does. With file size it's different anyway: _stat32 uses a
>     truncated st_size if file is too large.

This is really a problem. Different msvcrt versions behaves differently.
And POSIX stat() requires that it returns -1/EOVERFLOW when the file
size does not fit into the st_size field. I tested 32-bit Linux stat()
and it really behaves in this way. And also msvcr100+ _stat32() and
_stat64i32() behaves in this way. So for pre-msvcr100 is needed
different POSIX stat() wrapper than for msvcr100+ builds.

timestamps behaves across all msvcrt versions in the same way, overflow
is always indicated by the -1 value.

I will fix POSIX stat wrappers for st_size and also non-POSIX 32i64
wrappers for timestamps to be consistent.

>   - The new file mingw-w64-crt/include/filetime_to_time64.h isn't listed
>     in mingw-w64-crt/Makefile.am. It should be if "make dist" needs to
>     work.
> 
>   - Commit message typos:
> 
>       * "Additionaly define struct stat64 for LFS"
>          Additionally
> 
>       * "Function _time64 is avaulable since msvcr70.dll."
>                              available
> 
> Thanks!
> 
> -- 
> Lasse Collin

These points should be already fixed (in my worktree version).


_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to