On 24.02.2020 12:46, Jacek Caban wrote:
On 24.02.2020 12:28, Martin Storsjö wrote:
On Mon, 24 Feb 2020, Jacek Caban wrote:
Still, the problematic commit tries to solve some problems that are
already solved when using mingw-w64 *printf implementation. Since
non-underscored does not exist in msvcrt.dll, it's our extension
anyway. So how about making it always use __mingw_vsnprintf
regardless of __USE_MINGW_ANSI_STDIO instead? Applications aware of
msvcrt.dll will use underscored version which would end up straight
in msvcrt.dll anyway, so it should be fine with them.
I don't think that's desireable. As the msvcrt.dll _snprintf handles
format strings differently (ms_printf vs gnu_printf etc), having e.g.
fprintf and snprintf (when accessed from within the same translation
unit) implemented with a different backend would be rather messy.
I think the best way forward is the one with the least amount of
surprises/changes - the already committed patch looks fine and fixes
the null termination and return value, but it needs the patch I sent
earlier today (or something similar) to make __ms_snprintf an alias
for snprintf (for all the configure checks and similar that only
tests linking without including stdio.h).
Sure, that's fine with me.
Actually, do we really need __ms_snprintf? Could we just use snprintf()
in headers instead?
Thanks,
Jacek
_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public