bug-gnulib
[Top][All Lists]
Advanced

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

printf-posix: make an autoconf test more future-proof


From: Bruno Haible
Subject: printf-posix: make an autoconf test more future-proof
Date: Tue, 21 Jul 2020 09:49:03 +0200
User-agent: KMail/5.1.3 (Linux/4.4.0-179-generic; KDE/5.18.0; x86_64; ; )

The gl_PRINTF_DIRECTIVE_N test uses type 'uintptr_t'. While it happens to be
present from including <stdio.h> or <stdlib.h>, it's more future-proof to
explicitly include <inttypes.h>.


2020-07-21  Bruno Haible  <bruno@clisp.org>

        printf-posix: Make an autoconf test more future-proof.
        * m4/printf.m4 (gl_PRINTF_DIRECTIVE_N): Include <inttypes.h> before
        using uintptr_t.

diff --git a/m4/printf.m4 b/m4/printf.m4
index df473d8..fba8501 100644
--- a/m4/printf.m4
+++ b/m4/printf.m4
@@ -1,4 +1,4 @@
-# printf.m4 serial 64
+# printf.m4 serial 65
 dnl Copyright (C) 2003, 2007-2020 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -680,7 +680,10 @@ AC_DEFUN([gl_PRINTF_DIRECTIVE_N],
 #include <stdlib.h>
 #include <string.h>
 #ifdef _MSC_VER
-/* See page about "Parameter Validation" on msdn.microsoft.com.  */
+#include <inttypes.h>
+/* See page about "Parameter Validation" on msdn.microsoft.com.
+   
<https://docs.microsoft.com/en-us/cpp/c-runtime-library/parameter-validation>
+   
<https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/set-invalid-parameter-handler-set-thread-local-invalid-parameter-handler>
  */
 static void cdecl
 invalid_parameter_handler (const wchar_t *expression,
                            const wchar_t *function,




reply via email to

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