From 704ccd7be0311b317c1ef6907b9afe9ededd91a1 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Tue, 30 Apr 2024 13:14:31 +0200 Subject: [PATCH] *printf: Avoid a dialog during 'configure' with MSVC in debug mode. Suggested by Paul Harris in . * m4/printf.m4 (gl_PRINTF_DIRECTIVE_N): In the test program, include and disable the MSVC reporting for assertion failures. --- ChangeLog | 8 ++++++++ m4/printf.m4 | 6 +++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 5cd01d60d0..13ee25473c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2024-04-30 Bruno Haible + + *printf: Avoid a dialog during 'configure' with MSVC in debug mode. + Suggested by Paul Harris in + . + * m4/printf.m4 (gl_PRINTF_DIRECTIVE_N): In the test program, include + and disable the MSVC reporting for assertion failures. + 2024-04-30 Collin Funk gnulib-tool.py: Remove remaining unused instance variables. diff --git a/m4/printf.m4 b/m4/printf.m4 index 0cb14d6f00..220f37cb5e 100644 --- a/m4/printf.m4 +++ b/m4/printf.m4 @@ -1,5 +1,5 @@ # printf.m4 -# serial 91 +# serial 92 dnl Copyright (C) 2003, 2007-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -896,6 +896,7 @@ AC_DEFUN([gl_PRINTF_DIRECTIVE_N], #include #include #ifdef _MSC_VER +#include #include /* See page about "Parameter Validation" on msdn.microsoft.com. @@ -922,6 +923,9 @@ int main () int count = -1; #ifdef _MSC_VER _set_invalid_parameter_handler (invalid_parameter_handler); + /* Also avoid an Abort/Retry/Ignore dialog in debug builds. + */ + _CrtSetReportMode (_CRT_ASSERT, 0); #endif signal (SIGABRT, abort_handler); /* Copy the format string. Some systems (glibc with _FORTIFY_SOURCE=2) -- 2.39.5