From 027feae782117cd7bf04068e17b68e64de175631 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sat, 10 Sep 2022 01:39:48 +0300 Subject: [PATCH 47/47] configure: Require vsnprintf() to have C99 return value We're not going to support C89 vsnprintf() any more. See osdn #45630 Signed-off-by: Marko Lindqvist --- m4/vsnprintf.m4 | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/m4/vsnprintf.m4 b/m4/vsnprintf.m4 index 282172fae5..8618d4611d 100644 --- a/m4/vsnprintf.m4 +++ b/m4/vsnprintf.m4 @@ -18,7 +18,7 @@ AC_DEFUN([FC_FUNC_VSNPRINTF], #include int -doit(char * s, ...) +doit(char *s, ...) { char buffer[32]; va_list args; @@ -30,10 +30,9 @@ doit(char * s, ...) r = vsnprintf(buffer, 5, s, args); va_end(args); - /* -1 is pre-C99, 7 is C99. */ - - if (r != -1 && r != 7) + if (r != 7) { exit(1); + } /* We deliberately do not care if the result is NUL-terminated or not, since this is easy to work around like this. */ -- 2.35.1