Re: [Mingw-w64-public] [PATCH 2/2] headers: Declare debug _CRTDBG_MAP_ALLOC macros

2024-12-04 Thread Pali Rohár
On Wednesday 04 December 2024 14:51:34 LIU Hao wrote: > 在 2024-12-04 04:17, Pali Rohár 写道: > > It allowed me to compile application in debug mode with msvcrtd.dll > > memory leak detector and then run it. It was compiled in the same way > > via gcc and msvc. > > > > I do not know a better way how

[Mingw-w64-public] [PATCH v2] gendef: Recognize PE binaries which do not have all Data Directories

2024-12-04 Thread Pali Rohár
PE format allows to have variable length of Data Directories in PE Optional Header. The exact number of Data Directories is stored in NumberOfRvaAndSizes field. Size of the optional header depends on the number of Data Directories. Constants IMAGE_SIZEOF_NT_OPTIONAL32_HEADER and IMAGE_SIZEOF_NT_O

Re: [Mingw-w64-public] [PATCH] crt: Remove C23 initialization with ={}

2024-12-04 Thread Martin Storsjö
On Wed, 4 Dec 2024, LIU Hao wrote: 在 2024-12-04 18:00, Martin Storsjö 写道: This initialization isn't needed, static variables are guaranteed to be zero initialized anyway. This syntax of using an empty brace list is only supported since C23 (even though compilers may accept it in older language

Re: [Mingw-w64-public] [PATCH] crt: Remove C23 initialization with ={}

2024-12-04 Thread LIU Hao
在 2024-12-04 18:00, Martin Storsjö 写道: This initialization isn't needed, static variables are guaranteed to be zero initialized anyway. This syntax of using an empty brace list is only supported since C23 (even though compilers may accept it in older language modes too). This removes one unneces

Re: [Mingw-w64-public] [PATCH 2/4] crt: Split mingw_vfwscanf.c into mingw_swformat.c, mingw_vfwscanf.c and mingw_vswscanf.c

2024-12-04 Thread LIU Hao
在 2024-11-30 06:44, Martin Storsjö 写道: Amended this one locally with this bit:     While splitting, rename the struct _IFP into _IFPW, to disambiguate     it from the narrow char version of it, in other translation units. // Martin The changes in this thread all look good to me, including t

Re: [Mingw-w64-public] [PATCH] crt: Localize usage of startinfo variable

2024-12-04 Thread Martin Storsjö
On Tue, 3 Dec 2024, Pali Rohár wrote: On Tuesday 03 December 2024 16:33:01 Martin Storsjö wrote: On Wed, 27 Nov 2024, Pali Rohár wrote: Variable startinfo is used only by __(w)getmainargs() call passed by the pointer in pre_cpp_init() function. The __(w)getmainargs() function does not use or

Re: [Mingw-w64-public] [PATCH] gendef: Recognize PE binaries which do not have all Data Directories

2024-12-04 Thread Martin Storsjö
On Tue, 3 Dec 2024, Pali Rohár wrote: On Tuesday 03 December 2024 16:35:38 Martin Storsjö wrote: On Fri, 29 Nov 2024, Pali Rohár wrote: PE format allows to have variable length of Data Directories in PE Optional Header. The exact number of Data Directories is stored in NumberOfRvaAndSizes fie

Re: [Mingw-w64-public] [PATCH 1/2] crt: Call __mingw_init_ehandler() after _pei386_runtime_relocator() also for DLL builds

2024-12-04 Thread Martin Storsjö
On Tue, 3 Dec 2024, Pali Rohár wrote: On Tuesday 03 December 2024 16:19:58 Martin Storsjö wrote: On Wed, 27 Nov 2024, Pali Rohár wrote: For EXE builds __mingw_init_ehandler() function is called after the _pei386_runtime_relocator() from the __tmainCRTStartup() (and not from the WinMainCRTStar

Re: [Mingw-w64-public] [PATCH 2/2] crt: Align i386 stack to 16-bytes for DLL builds due to SSE

2024-12-04 Thread Martin Storsjö
On Wed, 4 Dec 2024, LIU Hao wrote: 在 2024-12-04 03:52, Pali Rohár 写道: This feels like a typo - I presume it should say "in DllMain/DllEntryPoint or in functions called _by_ DllMain/DllEntryPoint"? I see that the existing case in crtexe.c has a similar typo. I copied the comment from the crt

[Mingw-w64-public] [PATCH] crt: Remove C23 initialization with ={}

2024-12-04 Thread Martin Storsjö
This initialization isn't needed, static variables are guaranteed to be zero initialized anyway. This syntax of using an empty brace list is only supported since C23 (even though compilers may accept it in older language modes too). This removes one unnecessary change from 997473bddf5b6b256599f703

Re: [Mingw-w64-public] [PATCH] crt: Fix t_vsscanf test case

2024-12-04 Thread Martin Storsjö
On Tue, 3 Dec 2024, Pali Rohár wrote: Test must exit with status code 0 on success. memcmp() returns 0 when two buffers are same, so use directly value from memcmp() as status code. --- mingw-w64-crt/testcases/t_vsscanf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mingw-w

[Mingw-w64-public] [PATCH] headers: Add CacheUnknown in winnt.h

2024-12-04 Thread Biswapriyo Nath
From cee40eede8689d054e3cacca4ef37a58e994f270 Mon Sep 17 00:00:00 2001 From: Biswapriyo Nath Date: Wed, 4 Dec 2024 09:08:34 + Subject: [PATCH] headers: Add CacheUnknown in winnt.h Required for https://github.com/google/benchmark/commit/24e0bd82 Signed-off-by: Biswapriyo Nath --- mingw-w64