From b96415a44386d9f443850a91187757d873a16d95 Mon Sep 17 00:00:00 2001 From: Ryan Schmidt Date: Fri, 16 Apr 2021 19:42:32 -0500 Subject: [PATCH] Include required headers in module.ac tests Without these includes, functions exit, memset, strcmp, and strcpy are implicitly declared, which generates warnings. On new compilers, like the versions of clang included with Xcode 12 or later, implicitly declared functions are treated as errors, causing the configure tests to fail. The build later fails because the configure script made the wrong determinations. --- compat/module.ac | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/compat/module.ac b/compat/module.ac index a76cf1c..0cfa43b 100644 --- a/compat/module.ac +++ b/compat/module.ac @@ -31,6 +31,8 @@ AC_DEFUN([COMPAT_FUNC_BASENAME], [ [compat_cv_func_basename_works], [AC_TRY_RUN([ #include +#include +#include #ifdef HAVE_LIBGEN_H # include #endif @@ -85,6 +87,8 @@ AC_DEFUN([COMPAT_FUNC_DIRNAME], [ [compat_cv_func_dirname_works], [AC_TRY_RUN([ #include +#include +#include #ifdef HAVE_LIBGEN_H # include #endif @@ -157,6 +161,7 @@ AC_DEFUN([COMPAT_FUNC_GLOB], [ [compat_cv_func_glob_works], [AC_TRY_RUN([ #include +#include #ifdef HAVE_GLOB_H # include #endif @@ -208,6 +213,7 @@ AC_DEFUN([COMPAT_FUNC_MAKEDEV], [ [compat_cv_func_makedev_three_args], [AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ +#include #include #ifdef MAJOR_IN_MKDEV # include @@ -248,6 +254,8 @@ AC_DEFUN([COMPAT_FUNC_SNPRINTF], [ [compat_cv_func_snprintf_works], [AC_TRY_RUN([ #include +#include +#include typedef struct { int length;