在 2026-7-9 08:55, Kirill Makurin 写道:
Pali Rohár <[email protected]> wrote:

Those changes looks good.

Just one thing, for me it looks quite strange to call wprintf() with
ASCII-only strings. printf() in this case should be enough for 7-bit ASCII.

I've got this habit of using primarily wide stdio functions while working on 
posix32 library. I think using them is the right thing on Windows, although I'm 
not going to try to force anyone to do the same.

However, this reminded me that with msvcrt.dll, we will end up using 
mingw-w64's `wprintf`, which pulls in pretty large amount of static code. I 
think we could add

```
#define __USE_MINGW_ANSI_STDIO 0
```

before including any header file. Can this little fix-up be added after 
applying the patch?

It should be fine.

Besides, unrelated to this change, there are some erroneous assertions:

diff --git a/mingw-w64-crt/testcases/t_wcrtomb.c 
b/mingw-w64-crt/testcases/t_wcrtomb.c
index f7186c570..713ff1471 100644
--- a/mingw-w64-crt/testcases/t_wcrtomb.c
+++ b/mingw-w64-crt/testcases/t_wcrtomb.c
@@ -112,7 +112,7 @@ int main (void) {

       assert (wcrtomb (&c, wc, &state) == (size_t) -1);
       assert (c == EOF);
-      assert (errno = EILSEQ);
+      assert (errno == EILSEQ);
       assert (mbsinit (&state));

       // reset errno
@@ -196,7 +196,7 @@ int main (void) {
       assert (wcrtomb (&c, wc, &state) == (size_t) -1);
       /* This assertion fails with CRT's version */
       assert (c == EOF);
-      assert (errno = EILSEQ);
+      assert (errno == EILSEQ);
       assert (mbsinit (&state));

       // reset errno
@@ -263,7 +263,7 @@ skip_sbcs:
       assert (wcrtomb (&c, wc, &state) == (size_t) -1);
       /* This assertion fails with CRT's version */
       assert (c == EOF);
-      assert (errno = EILSEQ);
+      assert (errno == EILSEQ);
       assert (mbsinit (&state));

       // reset errno




--
Best regards,
LIU Hao

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature

_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to