On Mon, 24 Feb 2020, Jacek Caban wrote:
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?
You mean just rename __ms_snprintf to snprintf?
I guess that could work. A lot of them are wrapped up with names like
__ms_<funcname> - more of them than I really see on the first glance why
it's necessary. But e.g. vfprintf is just accessed as is with its normal
name directly from the import library, and __ms_fwprintf is just an import
library alias.
For this case I guess we could just rename them - but the fortify wrapping
in headers for e.g. vsnprintf seems to kind of need it to be available
with a different name as well.
// Martin
_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public