On Thu, 17 Apr 2025, Pali Rohár wrote:

There is missing call _configthreadlocale(-1) in pre_c_init function.
Startup code from Visual C++ runtime is doing same thing.

This applies only for msvcr80+ and UCRT builds. For older msvcrt versions
there is only empty wrapper.
---
mingw-w64-crt/crt/crtexe.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/mingw-w64-crt/crt/crtexe.c b/mingw-w64-crt/crt/crtexe.c
index 4bc8a92f497a..6da7e23fba92 100644
--- a/mingw-w64-crt/crt/crtexe.c
+++ b/mingw-w64-crt/crt/crtexe.c
@@ -112,6 +112,7 @@ pre_c_init (void)

  if (__globallocalestatus == -1)
    {
+      _configthreadlocale(-1);

What is the parameter -1 here?

According to the docs, we can pass _ENABLE_PER_THREAD_LOCALE (1) or _DISABLE_PER_THREAD_LOCALE (2), or 0 to query the current setting. But the docs don't say anything about passing -1 as parameter.

// Martin

_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to