Re: [Mingw-w64-public] [PATCH] crt: Increase precision of gettimeofday() if possible.

2021-05-02 Thread Dan Raymond
1. `clock_gettime()` is not meant to be precise, and it shouldn't be, because the extra accuracy is useless. (It may make some sense for logging, as mentioned in another message; but in logs only the order of writes matters, while timestamps don't matter.) I don't agree with this.  First: pr

Re: [Mingw-w64-public] Posix versus Win32 binaries

2020-03-04 Thread Dan Raymond
On 3/3/2020 6:16 AM, Liu Hao wrote: There are prebuilt native toolchains so you can have GCC, GDB etc. as native programs which do not require MSYS2 (note GDB may require Python3 which is native too) so there is no need to install MSYS2, unless you also need GNU make, BASH, etc. I am running m

Re: [Mingw-w64-public] snprintf() vs. _snprintf()

2020-02-23 Thread Dan Raymond
I've been thinking some more about this and maybe we are going about it wrong.  How did we get here in the first place?  I don't know the entire history of MinGW but I suspect this came about from the very early days when people were trying to port Unix applications to Windows.  Those applicati

Re: [Mingw-w64-public] snprintf() vs. _snprintf()

2020-02-22 Thread Dan Raymond
On 2/22/2020 2:54 PM, Martin Storsjö wrote: Yes, one shouldn't use functions outside of that subset, or ideally not link against msvcrt.dll at all. The proper solution to this is to use UCRT instead - this is now possible since a few years. I'm fairly sure that we rely on a number of function

[Mingw-w64-public] snprintf() vs. _snprintf()

2020-02-22 Thread Dan Raymond
Pali Rohár recently raised an issue regarding snprintf() and he pointed out a valid concern.  The MinGW toolchain has been silently redirecting snprintf() to the MSFT-specific non-conforming _snprintf().  This creates a substantial security risk for any application compiled using MinGW.  When a