On Tue, 21 Oct 2025, Peter Damianov via Mingw-w64-public wrote:
Implement 0b/0B binary prefix support in strtol, strtoul, wcstol, wcstoul
and related functions for C23 compliance.
* Add %b prefix parsing to strtoimax/wcstoimax/strtoumax/wcstoumax
* Add implementations of strtol, strtoul, wcstol, wcstoul with %b prefix
parsing in misc/
* Expose new implementations of strtox family in stdlib.h and wchar.h when
__USE_MINGW_STRTOX is defined
Signed-off-by: Peter Damianov <[email protected]>
A couple points:
So while UCRT does implement C99, it probably doesn't implement C23 yet -
or does it? Within mingw-w64-crt, we have as a general direction tried to
reduce the amount of custom CRT functions that we link in, and use more of
the bare UCRT as is.
But as newer standards require more functionality, and UCRT doesn't
provide it (yet?), I guess it's inevitable that we might have to
re-override more functions again.
After this patch, we end up with both the CRT libraries, and libmingwex,
providing the functions (e.g. "strtol"). That's not ideal, because
depending on linking order, you may end up with either the CRT's
definition, or libmingwex's. So if we want libmingwex to provide this
function (across all CRTs), then we should also probably stop providing
that function from the CRT import library, for consistency. (If there was
a case where we'd want to provide it for some, but not all, CRTs, we
should add it to those import libraries rather than libmingwex.)
What's the origin of the added code? Is it old mingw-w64 code, or
something else? (It doesn't look like code written fresh from scratch,
given peculiarities like use of "register" for variables...) If it's
something else, is the copyright header accurate?
Finally - it'd be nice if we'd have some tests for this.
// Martin
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public