From c71b11862e9970660dda8f2190f960e7c19bd95d Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Sat, 3 Dec 2022 13:18:37 +0100 Subject: [PATCH] configure: Port HAVE_C99_VSNPRINTF to C99 The 1999 revision removed implicit function declarations, so include the appropriate header files. Also declare main with an explicit return type (implicit ints were removed, too). --- configure | 5 ++++- configure.ac | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 215fec3..8c6c1e6 100755 --- a/configure +++ b/configure @@ -6934,6 +6934,9 @@ else #include #include +#include +#include +#include void foo(const char *format, ...) { va_list ap; int len; @@ -6953,7 +6956,7 @@ void foo(const char *format, ...) { exit(0); } -main() { foo("hello"); } +int main() { foo("hello"); } _ACEOF if ac_fn_c_try_run "$LINENO"; then : diff --git a/configure.ac b/configure.ac index 1ef4b5a..6166c74 100644 --- a/configure.ac +++ b/configure.ac @@ -203,6 +203,9 @@ AC_CACHE_CHECK([for C99 vsnprintf],ac_cv_HAVE_C99_VSNPRINTF,[ AC_TRY_RUN([ #include #include +#include +#include +#include void foo(const char *format, ...) { va_list ap; int len; @@ -222,7 +225,7 @@ void foo(const char *format, ...) { exit(0); } -main() { foo("hello"); } +int main() { foo("hello"); } ], ac_cv_HAVE_C99_VSNPRINTF=yes,ac_cv_HAVE_C99_VSNPRINTF=no,ac_cv_HAVE_C99_VSNPRINTF=cross)]) if test x"$ac_cv_HAVE_C99_VSNPRINTF" = x"yes"; then