Blob Blame History Raw
Include <stdlib.h> for a declaration of memset.  This prevents future
compilers from changing the outcome of this configure check, once they
no longer support implicit function declarations.

NB: This patch changes both configure.in and configure.  Although
configure is regenerated during the build, the non-updated version
runs first, triggering a build failure with the compiler instrumented
for logging implicit function declarations.

Submitted upstream: <https://savannah.nongnu.org/patch/index.php?10312>

diff --git a/configure b/configure
index 6a07dfab67a59557..125b80d867ea0991 100755
--- a/configure
+++ b/configure
@@ -19127,6 +19127,7 @@ else
 /* end confdefs.h.  */
 
 #include <stdio.h>
+#include <stdlib.h>
 
 int main()
 {
@@ -19166,6 +19167,7 @@ else
 
 #include <stdio.h>
 #include <stdarg.h>
+#include <stdlib.h>
 
 int doit(char *buf, int len, const char *s, ...)
 {
diff --git a/configure.in b/configure.in
index a0691e08ba2c2b34..514998dcf7852cdd 100644
--- a/configure.in
+++ b/configure.in
@@ -940,6 +940,7 @@ AC_CHECK_FUNCS(asprintf vasprintf snprintf vsnprintf getpass setenv)
 AC_CACHE_CHECK(for ISO C99 compliant snprintf,ac_cv_func_snprintf_c99,
 	[AC_TRY_RUN([
 #include <stdio.h>
+#include <stdlib.h>
 
 int main()
 {
@@ -955,6 +956,7 @@ AC_CACHE_CHECK(for ISO C99 compliant vsnprintf,ac_cv_func_vsnprintf_c99,
 	[AC_TRY_RUN([
 #include <stdio.h>
 #include <stdarg.h>
+#include <stdlib.h>
 
 int doit(char *buf, int len, const char *s, ...)
 {