Re: [Mingw-w64-public] [PATCH 2/2] crt: testcases: Remove a "throw (int)"

2025-06-24 Thread LIU Hao
在 2025-6-24 19:55, Martin Storsjö 写道: This fixes building in C++17 mode, with errors like: ../testcases/t_trycatch.cpp:3:18: error: ISO C++17 does not allow dynamic exception specifications [-Wdynamic-exception-spec] 3 | void foo (int d) throw (int) | ^~~ S

Re: [Mingw-w64-public] [PATCH] crt: Fix running "make check" testsuite

2025-06-24 Thread Martin Storsjö
On Tue, 24 Jun 2025, Pali Rohár wrote: The issues encountered by both the Clang and GCC builds are: ../testcases/t_ansi_io.c: In function 'main': ../testcases/t_ansi_io.c:11:10: fatal error: _mingw_print_push.h: No such file or directory 11 | #include <_mingw_print_push.h> (This header was

Re: [Mingw-w64-public] [PATCH] crt: Fix running "make check" testsuite

2025-06-24 Thread Pali Rohár
On Tuesday 24 June 2025 14:47:45 Martin Storsjö wrote: > On Tue, 24 Jun 2025, Pali Rohár wrote: > > > On Tuesday 24 June 2025 14:41:10 Martin Storsjö wrote: > > > On Tue, 24 Jun 2025, Martin Storsjö wrote: > > > > > > > On Sat, 21 Jun 2025, Pali Rohár wrote: > > > > > > > > > AM_CFLAGS contains

[Mingw-w64-public] [PATCH 5/9] crt: Add support for mingw_pformat %ws, %wS, %wc and %wC

2025-06-24 Thread Pali Rohár
Modifier w for %s, %S, %c and %C is same as modifier l. It is common that wchar_t* string is printed by %ws format by Windows applications. This change allows to use %ws by applications compiled by flag -D__USE_MINGW_ANSI_STDIO=1, which is by default enabled for C99+ msvcrt.dll builds. Modifier w

[Mingw-w64-public] [PATCH 6/9] crt: Add tests for printf format %c/%C and %s/%S

2025-06-24 Thread Pali Rohár
--- mingw-w64-crt/Makefile.am | 6 ++ mingw-w64-crt/testcases/t_format_CS.c | 2 + mingw-w64-crt/testcases/t_format_CS0.c | 2 + mingw-w64-crt/testcases/t_format_CS1.c | 2 + mingw-w64-crt/testcases/t_format_CS_tmpl.h | 118 + 5 files chang

[Mingw-w64-public] [PATCH 9/9] crt: Add tests for printf format %Z

2025-06-24 Thread Pali Rohár
--- mingw-w64-crt/Makefile.am | 6 ++ mingw-w64-crt/testcases/t_format_Z.c | 2 + mingw-w64-crt/testcases/t_format_Z0.c | 2 + mingw-w64-crt/testcases/t_format_Z1.c | 2 + mingw-w64-crt/testcases/t_format_Z_tmpl.h | 108 ++ 5 files changed,

[Mingw-w64-public] [PATCH 2/9] crt: Replace using of printf %ws format by %ls format

2025-06-24 Thread Pali Rohár
Experiments showed that printf format %ws is supported in all CRT libraries except: - msvcrt20.dll (Visual C++ 2.0 - 2.2) - msvcrt40.dll (Visual C++ 4.0 - 4.1) - msvcr40d.dll (Visual C++ 4.0 - 4.1) - mingw-w64 (__mingw_printf function) Calling printf("%ws", ...) for above cases just prints "%ws".

[Mingw-w64-public] [PATCH 4/9] crt: Fix support for mingw_pformat %c and %s in wide wprintf

2025-06-24 Thread Pali Rohár
Format %c and %s when used in some wide wprintf function takes the wide wchar_t char or wide wchar_t* string. This is msvcrt.dll and UCRT behavior. This change aligns the mingw-w64 wprintf functions to be compatible with MS. --- mingw-w64-crt/stdio/mingw_pformat.c | 12 ++-- 1 file change

[Mingw-w64-public] [PATCH 8/9] crt: Add support for mingw_pformat %Z, %hZ, %lZ, %wZ

2025-06-24 Thread Pali Rohár
Format %Z takes pointer to ANSI_STRING or UNICODE_STRING based on the wideness of format. In this mingw-w64 implementation (same as in UCRT) the uppercase format %Z has the same default wideness as uppercase format %S when no h, l or w modifier is specified. Format %Z is supported by crtdll, msvc

[Mingw-w64-public] [PATCH 1/9] crt: Ensure that for non-__USE_MINGW_ANSI_STDIO test cases is __USE_MINGW_ANSI_STDIO undefined

2025-06-24 Thread Pali Rohár
--- mingw-w64-crt/testcases/t_snprintf.c | 1 + mingw-w64-crt/testcases/t_snwprintf.c | 1 + mingw-w64-crt/testcases/t_swprintf.c | 1 + 3 files changed, 3 insertions(+) diff --git a/mingw-w64-crt/testcases/t_snprintf.c b/mingw-w64-crt/testcases/t_snprintf.c index 373a9373c86d..1230fab4b4ef 10

[Mingw-w64-public] [PATCH 7/9] crt: Fix __pformat_wputchars() for swprintf

2025-06-24 Thread Pali Rohár
__pformat_wputchars() for snprintf, __pformat_puchats() for swprintf and __pformat_puchats() for snprintf prints all characters including nul chars. So change __pformat_wputchars() for swprintf to align this behavior. This change is needed for swprintf(%wZ) support in follow up change. --- mingw-

[Mingw-w64-public] [PATCH 3/9] crt: Fix support for mingw_pformat %C and %S

2025-06-24 Thread Pali Rohár
Format %C and %S uses opposite wideness as format %c and %s. So %S in printf uses wchar_t* string and in wprintf uses char* string. Format %C and %S can be changed by l or h modifiers, like %c and %s. So for example %hC uses char type in both printf and wprintf calls and for example %lS uses wchar

Re: [Mingw-w64-public] [PATCH] crt: Fix compilation of libscrnsavw.a

2025-06-24 Thread Pali Rohár
On Tuesday 24 June 2025 17:19:19 Martin Storsjö wrote: > On Mon, 23 Jun 2025, Pali Rohár wrote: > > > On Monday 23 June 2025 15:42:08 Martin Storsjö wrote: > > > On Sat, 21 Jun 2025, Pali Rohár wrote: > > > > > > > Setting the lib32_libscrnsavw_a_CFLAGS variable automatically turns off > > > > us

Re: [Mingw-w64-public] [PATCH] crt: Fix running "make check" testsuite

2025-06-24 Thread Pali Rohár
On Tuesday 24 June 2025 23:27:07 Martin Storsjö wrote: > On Tue, 24 Jun 2025, Pali Rohár wrote: > > > On Tuesday 24 June 2025 17:13:01 Martin Storsjö wrote: > > > On Tue, 24 Jun 2025, Martin Storsjö wrote: > > > > > > > On Tue, 24 Jun 2025, Pali Rohár wrote: > > > > > > > > > When I run tests ma

[Mingw-w64-public] [PATCH 1/2] crt: testcases: Remove leftover includes of _mingw_print_push.h

2025-06-24 Thread Martin Storsjö
This header was removed in 70860d945e6be713af352ee62820bccb653589c2 in 2018. Signed-off-by: Martin Storsjö --- mingw-w64-crt/testcases/t_ansi_io.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/mingw-w64-crt/testcases/t_ansi_io.c b/mingw-w64-crt/testcases/t_ansi_io.c index dc3d0caf3..35f8

[Mingw-w64-public] [PATCH 2/2] crt: testcases: Use stdlib.h for the declaration of _sys_errlist

2025-06-24 Thread Martin Storsjö
From: Pali Rohár This fixes linking this test with UCRT. Signed-off-by: Martin Storsjö --- mingw-w64-crt/testcases/tstmain_sys_xxx.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mingw-w64-crt/testcases/tstmain_sys_xxx.c b/mingw-w64-crt/testcases/tstmain_sys_xxx.c inde

Re: [Mingw-w64-public] [PATCH] crt: Fix running "make check" testsuite

2025-06-24 Thread Martin Storsjö
On Tue, 24 Jun 2025, Pali Rohár wrote: On Tuesday 24 June 2025 17:13:01 Martin Storsjö wrote: On Tue, 24 Jun 2025, Martin Storsjö wrote: On Tue, 24 Jun 2025, Pali Rohár wrote: When I run tests manually at the time of sending those my changes, they passed on 32-bit msvcrt locally. FWIW, yo

Re: [Mingw-w64-public] [PATCH] crt: Fix running "make check" testsuite

2025-06-24 Thread Pali Rohár
On Tuesday 24 June 2025 14:32:21 Martin Storsjö wrote: > On Sat, 21 Jun 2025, Pali Rohár wrote: > > > AM_CFLAGS contains cflags required to build the mingw-w64 CRT source code. > > They are not intended to compile applications (including those used in > > mingw-w64 testsuite). Setting per-target _

Re: [Mingw-w64-public] [PATCH] crt: Fix running "make check" testsuite

2025-06-24 Thread Pali Rohár
On Tuesday 24 June 2025 17:13:01 Martin Storsjö wrote: > On Tue, 24 Jun 2025, Martin Storsjö wrote: > > > On Tue, 24 Jun 2025, Pali Rohár wrote: > > > > > When I run tests manually at the time of sending those my changes, they > > > passed on 32-bit msvcrt locally. > > > > FWIW, you probably hav

Re: [Mingw-w64-public] [PATCH] crt: Fix compilation of libscrnsavw.a

2025-06-24 Thread Martin Storsjö
On Mon, 23 Jun 2025, Pali Rohár wrote: On Monday 23 June 2025 15:42:08 Martin Storsjö wrote: On Sat, 21 Jun 2025, Pali Rohár wrote: Setting the lib32_libscrnsavw_a_CFLAGS variable automatically turns off usage of AM_CFLAGS variable for that target. As the AM_CFLAGS contains the mingw-w64 CRT

Re: [Mingw-w64-public] [PATCH 2/2] crt: testcases: Remove a "throw (int)"

2025-06-24 Thread Martin Storsjö
On Tue, 24 Jun 2025, LIU Hao wrote: 在 2025-6-24 19:55, Martin Storsjö 写道: This fixes building in C++17 mode, with errors like: ../testcases/t_trycatch.cpp:3:18: error: ISO C++17 does not allow dynamic exception specifications [-Wdynamic-exception-spec] 3 | void foo (int d) throw (int)

Re: [Mingw-w64-public] [PATCH] crt: Fix running "make check" testsuite

2025-06-24 Thread Martin Storsjö
On Tue, 24 Jun 2025, Martin Storsjö wrote: On Tue, 24 Jun 2025, Pali Rohár wrote: When I run tests manually at the time of sending those my changes, they passed on 32-bit msvcrt locally. FWIW, you probably have old headers lying around in your sysroot if you don't notice the issue with the

[Mingw-w64-public] [PATCH] crt: Read the right st_mode field for __mingw_fix_stat_finish

2025-06-24 Thread Martin Storsjö
This fixes a regression from 53a3686f0920f1dc2fba34691d8eb8094851d82e; at this point, _Stat->st_mode is uninitialized in these functions. Signed-off-by: Martin Storsjö --- mingw-w64-crt/stdio/msvcr110pre_stat32.c | 2 +- mingw-w64-crt/stdio/msvcr110pre_stat64i32.c | 2 +- mingw-w64-crt/stdi

Re: [Mingw-w64-public] [PATCH] crt: Fix running "make check" testsuite

2025-06-24 Thread Martin Storsjö
On Tue, 24 Jun 2025, Pali Rohár wrote: When I run tests manually at the time of sending those my changes, they passed on 32-bit msvcrt locally. FWIW, you probably have old headers lying around in your sysroot if you don't notice the issue with the missing _mingw_print_push.h header, which ha

Re: [Mingw-w64-public] [PATCH] crt: Fix running "make check" testsuite

2025-06-24 Thread Pali Rohár
On Tuesday 24 June 2025 14:41:10 Martin Storsjö wrote: > On Tue, 24 Jun 2025, Martin Storsjö wrote: > > > On Sat, 21 Jun 2025, Pali Rohár wrote: > > > > > AM_CFLAGS contains cflags required to build the mingw-w64 CRT source code. > > > They are not intended to compile applications (including thos

[Mingw-w64-public] [PATCH 2/2] crt: testcases: Remove a "throw (int)"

2025-06-24 Thread Martin Storsjö
This fixes building in C++17 mode, with errors like: ../testcases/t_trycatch.cpp:3:18: error: ISO C++17 does not allow dynamic exception specifications [-Wdynamic-exception-spec] 3 | void foo (int d) throw (int) | ^~~ Signed-off-by: Martin Storsjö --- mingw-w

Re: [Mingw-w64-public] [PATCH] crt: Fix running "make check" testsuite

2025-06-24 Thread Martin Storsjö
On Tue, 24 Jun 2025, Martin Storsjö wrote: On Sat, 21 Jun 2025, Pali Rohár wrote: AM_CFLAGS contains cflags required to build the mingw-w64 CRT source code. They are not intended to compile applications (including those used in mingw-w64 testsuite). Setting per-target _CFLAGS variable overwrit

Re: [Mingw-w64-public] [PATCH] crt: Fix running "make check" testsuite

2025-06-24 Thread Martin Storsjö
On Sat, 21 Jun 2025, Pali Rohár wrote: AM_CFLAGS contains cflags required to build the mingw-w64 CRT source code. They are not intended to compile applications (including those used in mingw-w64 testsuite). Setting per-target _CFLAGS variable overwrites the AM_CFLAGS. So for every testcase sets

Re: [Mingw-w64-public] [PATCH] crt: Fix running "make check" testsuite

2025-06-24 Thread Martin Storsjö
On Mon, 23 Jun 2025, Pali Rohár wrote: I was trying to do it via some foreach, but I have not figured out how. The problem is that the Makefile.am is processed by GNU automake which process those those _CFLAGS variables. And if the automake does not see _CFLAGS then into target it puts $(AM_CFLA