Re: [Mingw-w64-public] [PATCH] crt: execv*/spawnv* const-correctness

2024-04-19 Thread Martin Storsjö
On Fri, 19 Apr 2024, Nikita Kniazev wrote: A "char**" pointer can't be implicitly converted to a "const char**" pointer - see https://c-faq.com/ansi/constmismatch.html for the full explanation for this issue. The function arguments are not "const char**", they are "const char* const*" so the

Re: [Mingw-w64-public] [PATCH] crt: execv*/spawnv* const-correctness

2024-04-19 Thread Nikita Kniazev
> A "char**" pointer can't be implicitly converted to a "const char**" > pointer - see https://c-faq.com/ansi/constmismatch.html for the full > explanation for this issue. The function arguments are not "const char**", they are "const char* const*" so there is no issue. int execve_before(const

[Mingw-w64-public] [PATCH 5/6] crt: msvcr70.def.in: Add missing __CxxCallUnwindVecDtor

2024-04-19 Thread Pali Rohár
Visual Studio .NET 2002 version of msvcr70.dll library (7.00.9466.0) contains additional symbol __CxxCallUnwindVecDtor. Some older library version (7.00.9210.0) does not have this symbol. Same set of symbols as in the released .NET 2002 version is available also in Visual Studio .NET 2002 Service P

Re: [Mingw-w64-public] [PATCH 6/9] crt: msvcr80.def.in: Fix some some I386 symbol names which miss @SIZE suffix

2024-04-19 Thread Pali Rohár
On Friday 19 April 2024 10:26:32 Martin Storsjö wrote: > On Fri, 19 Apr 2024, Martin Storsjö wrote: > > > On Thu, 18 Apr 2024, Pali Rohár wrote: > > > > > On Friday 19 April 2024 00:22:31 Martin Storsjö wrote: > > > > On Mon, 8 Apr 2024, Pali Rohár wrote: > > > > > > > > > I386 symbols __CxxLong

[Mingw-w64-public] [PATCH 3/6] crt: msvcrt40.def.in: Fix stdcall symbols with @SIZE suffix

2024-04-19 Thread Pali Rohár
_CxxThrowException, __CxxLongjmpUnwind, _adj_fdiv_*, _adj_fdivr_* and _seh_longjmp_unwind are present also in Windows NT-based OS system versions of msvcrt40.dll as redirects to msvcrt.dll library. gendef does not recognize stdcall convention by default for such redirected symbols and shows them w

[Mingw-w64-public] [PATCH 2/6] crt: msvcrt40.def.in: Fix informatin about __p__dstbias symbol

2024-04-19 Thread Pali Rohár
Symbol __p__dstbias is available in both NT and Win32s variants of Visual C++ 4.1 msvcrt40.dll version. --- mingw-w64-crt/lib32/msvcrt40.def.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mingw-w64-crt/lib32/msvcrt40.def.in b/mingw-w64-crt/lib32/msvcrt40.def.in index d

[Mingw-w64-public] [PATCH 4/6] crt: Fix _adj_fdiv_m* and _adj_fdivr_m* symbols

2024-04-19 Thread Pali Rohár
CRT library functions _adj_fdiv_m* and _adj_fdivr_m* have custom calling convention. These functions take two arguments. First argument is passed in x87 st(0) register and second argument on the stack (either 4 or 8 bytes). Function itself pops the stack (like stdcall convention) and return value i

[Mingw-w64-public] [PATCH 1/6] crt: msvcrt.def.in: Remove wrong comment about _endthread/_endthreadex symbols

2024-04-19 Thread Pali Rohár
These functions do not return and gendef false positively detected stdcall calling convention for them on Windows XP and SP1 binaries. Remove wrong comment. --- mingw-w64-crt/lib-common/msvcrt.def.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mingw-w64-crt/lib-common/m

[Mingw-w64-public] [PATCH 6/6] crt: msvcr80.def.in: Fix __fls_getvalue@4 and __fls_setvalue@8 symbols

2024-04-19 Thread Pali Rohár
Same change as in commit 9b17c3374aa9eb809938bbcf7cf37093e842a4a7 for the I386 msvcr80.def.in file. --- mingw-w64-crt/lib32/msvcr80.def.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mingw-w64-crt/lib32/msvcr80.def.in b/mingw-w64-crt/lib32/msvcr80.def.in index 6073d4c5

Re: [Mingw-w64-public] [PATCH] crt: execv*/spawnv* const-correctness

2024-04-19 Thread LIU Hao
在 2024-04-19 16:00, LIU Hao 写道: The conversion from `char**` to `const char* const*` is only implicit in C++, and not in C. The POSIX prototypes have only one `const` [1]. The Microsoft variants do have double `const` [2], so I think the proposed patch may be acceptable, as long as users have

Re: [Mingw-w64-public] [PATCH] crt: execv*/spawnv* const-correctness

2024-04-19 Thread LIU Hao
在 2024-04-19 15:37, Martin Storsjö 写道: -  _CRTIMP int __cdecl execvpe(const char *_Filename,char *const _ArgList[],char *const _Env[]) __MINGW_ATTRIB_DEPRECATED_MSVC2005; +  _CRTIMP int __cdecl execv(const char *_Filename,const char *const _ArgList[]) __MINGW_ATTRIB_DEPRECATED_MSVC2005; Thanks,

Re: [Mingw-w64-public] [PATCH] crt: execv*/spawnv* const-correctness

2024-04-19 Thread Martin Storsjö
On Thu, 18 Apr 2024, Nikita Kniazev wrote: From 0d9fb95b2c50a15a90276f67e7ec44c67cb1093b Mon Sep 17 00:00:00 2001 From: Nikita Kniazev Date: Thu, 18 Apr 2024 03:37:48 + Subject: [PATCH] crt: execv*/spawnv* const-correctness Signed-off-by: Nikita Kniazev --- mingw-w64-headers/crt/process.h

Re: [Mingw-w64-public] [PATCH 6/9] crt: msvcr80.def.in: Fix some some I386 symbol names which miss @SIZE suffix

2024-04-19 Thread Martin Storsjö
On Fri, 19 Apr 2024, Martin Storsjö wrote: On Thu, 18 Apr 2024, Pali Rohár wrote: On Friday 19 April 2024 00:22:31 Martin Storsjö wrote: On Mon, 8 Apr 2024, Pali Rohár wrote: I386 symbols __CxxLongjmpUnwind, _adj_fdiv_m*, _adj_fdivr_m* and _seh_longjmp_unwind have @SIZE suffix in I386 versi

Re: [Mingw-w64-public] [PATCH 6/9] crt: msvcr80.def.in: Fix some some I386 symbol names which miss @SIZE suffix

2024-04-19 Thread Martin Storsjö
On Thu, 18 Apr 2024, Pali Rohár wrote: On Friday 19 April 2024 00:22:31 Martin Storsjö wrote: On Mon, 8 Apr 2024, Pali Rohár wrote: I386 symbols __CxxLongjmpUnwind, _adj_fdiv_m*, _adj_fdivr_m* and _seh_longjmp_unwind have @SIZE suffix in I386 version of msvcr80.dll. I presume this is not a