On Sat, 30 Mar 2024, Pali Rohár wrote:
On Monday 25 March 2024 13:59:49 LIU Hao wrote:
在 2024-03-24 23:17, Pali Rohár 写道:
I see... The problem is that inline version of that function in stdio.h
conflicts with non-inline version in ucrt__scprintf.c file.
One option how to avoid this problem is to not include stdio.h into
ucrt__scprintf.c file.
Other option can be to remove inline version completely.
Please propose an updated patch for that.
In 'ucrt__snwprintf.c' there are some hacks around it.
Thank you for help. In attachment is an updated version. I checked that
it works on top of the current master branch (because original version
of the change is 2 years old now) and that it works for cases when
target application includes stdio.h header file and also when it does
not include it.
For changes like this, where we're adding non-inline functions for
_scprintf, _snprintf and _snscanf, I would very much prefer if we'd also
remove the inline form of these functions at the same time.
Right now, in the current form, the non-inline version of these functions
are almost dead code and untestable with normal, proper use of the
headers. It'd only be possible to test it by compiling code with headers
in non-UCRT mode and linking against an UCRT import library.
So instead, I'd prefer to remove the inline form of these functions, for
clarity and simplicity. Then all use of these functions in UCRT mode go
through these non-inline functions, and we can be sure that they work as
intended just by testing using these functions in any UCRT environment.
// Martin
_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public