bug-gettext
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

./configure with MSVC + Debug blocks with dialog box (fixed with patch!)


From: Paul Harris
Subject: ./configure with MSVC + Debug blocks with dialog box (fixed with patch!)
Date: Mon, 29 Apr 2024 12:24:02 +0800

Hello gettext gurus,

During ./configure, the "intl" configure step tests this condition:
checking whether printf supports the 'n' directive...

This fails on MSVC, which is fine on Release builds.

However, in Debug builds, a GUI Dialog box pops up telling the user about an assert failure, and would the user like to Abort,Retry,Ignore.

This blocks the configuration until the user manually presses a button.

In gettext-runtime/intl/configure (in the tarball release),
line 29702 has a call to _set_invalid_parameter_handler()
This almost does the job, but not quite.
adding the line: _CrtSetReportMode(_CRT_ASSERT, 0);
changes the behaviour to fail without the dialog box.

There are other places in the tarball where _set_invalid_parameter_handler() is called, and this line could be added in all of those places to be sure, but my tests show it is enough to add it to just this one place,

here is a patch:

diff -ru gettext-runtime/intl/configure gettext-runtime/intl/configure
--- gettext-runtime/intl/configure 2023-06-17 19:53:51.000000000 +0800
+++ gettext-runtime/intl/configure 2024-04-29 10:52:53.723390500 +0800
@@ -29700,6 +29700,7 @@
   int count = -1;
 #ifdef _MSC_VER
   _set_invalid_parameter_handler (invalid_parameter_handler);
+  _CrtSetReportMode(_CRT_ASSERT, 0);
 #endif
   /* Copy the format string.  Some systems (glibc with _FORTIFY_SOURCE=2)
      support %n in format strings in read-only memory but not in writable


These files appear to be generated for the benefit of the tarball, and aren't found in the git at all, so I wasn't sure how to patch anywhere else.
Perhaps this belongs in m4 or coreutils or autoconf ?  I'm not sure.

Best regards,
Paul




reply via email to

[Prev in Thread] Current Thread [Next in Thread]