On Fri, 29 Nov 2024, Pali Rohár wrote:
On Saturday 30 November 2024 00:46:09 Martin Storsjö wrote:
On Fri, 29 Nov 2024, Martin Storsjö wrote:
On Tue, 19 Nov 2024, Pali Rohár wrote:
The stdio/scanf.S file has got quite good comments explaining parts of
it. But some parts of the comments there feel inaccurate (like "This
is needed because mingw-w64 uses msvcr100.dll" - that's not really the
default anywhere), so a patch to fix up inaccuracies in the comments
there would be nice.
That is good catch. That comment does not make sense. mingw-w64 was
using msvcrt.dll before UCRT. Not the msvcr100.dll.
What about updating comment to something like this?
"This is needed for pre-msvcr120 CRT libraries, which do not support
the v*scanf functions."
Such a comment sounds good to me, thanks!
I rewrote this commit message into this bit:
crt: Move vscanf-family functions from libmingwex.a to individual CRT
import libraries
msvcr110 and earlier did not have any v*scanf functions. Because of
that, the mingw-w64-crt contained wrappers that implement the
v*scanf functions based on the non-variadic *scanf functions, by
reading the va_list object and re-passing them as regular parameters
to the *scanf functions.
The sequence involved for vsscanf is:
- stdio/vsscanf2.S, providing vsscanf, calling __ms_vsscanf
- stdio/vsscanf.c, providing __ms_vsscanf, calling __argtos
- stdio/scanf.S, providing __argtos, which converts from a
va_list back to regular parameters, and calls sscanf()
These functions were provided in libmingwex, making them available
and used with all CRT versions.
However, since msvcr120 (and in UCRT), the proper v*scanf functions
are available. Therefore, move this set of wrappers into the
individual CRT import libraries, allowing using the proper v*scanf
functions on msvcr120 and UCRT.
Does that sound ok?
// Martin
Thank you very much for looking at this. Your commit message is much
better than my very short description. So for sure, it sounds good.
Ok, thanks, I pushed this now.
I didn't look at the added test here (and not much on the test added in an
earlier patch series either); I'm not familiar with how to build/run those
tests. Can you briefly tell me how to use them? And is it possible to
execute the tests e.g. wrapped in wine on linux? (That obviously doesn't
always correctly indicate whether the tests work correctly on windows, but
it can be used as a quick extra check at least.)
// Martin
_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public