Blob Blame History Raw
Avoid implicit function declarations in the configure script.  Replace
exit calls with direct returns if applicable, or include the relevant
headers.  This is necessary for compatibility with strict(er) C99
compilers which do not support implicit function declarations.

diff --git a/configure b/configure
index cb80200c8e633b24..769032dc42fa3e7c 100755
--- a/configure
+++ b/configure
@@ -2178,7 +2178,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   for ac_declaration in \
-   '' \
+   '#include <stdlib.h>' \
    'extern "C" void std::exit (int) throw (); using std::exit;' \
    'extern "C" void std::exit (int); using std::exit;' \
    'extern "C" void exit (int) throw ();' \
@@ -3855,8 +3855,8 @@ main ()
   for (i = 0; i < 256; i++)
     if (XOR (islower (i), ISLOWER (i))
 	|| toupper (i) != TOUPPER (i))
-      exit(2);
-  exit (0);
+      return 2;
+  return 0;
 }
 _ACEOF
 rm -f conftest$ac_exeext
@@ -6847,7 +6847,7 @@ main ()
 /* If this system has a BSD-style setpgrp which takes arguments,
   setpgrp(1, 1) will fail with ESRCH and return -1, in that case
   exit successfully. */
-  exit (setpgrp (1,1) == -1 ? 0 : 1);
+  return setpgrp (1,1) == -1 ? 0 : 1;
   ;
   return 0;
 }
@@ -7889,6 +7889,8 @@ precode='#include <sys/types.h>
 #include <sys/ioctl.h>
 #include <sys/file.h>
 #include <signal.h>
+#include <stdlib.h>
+#include <unistd.h>
 
 typedef void (*sighandler_t)(int);
 sighandler_t signal(int signum, sighandler_t handler);
diff --git a/configure.in b/configure.in
index a047afb4577f6116..20271de30d8722b9 100644
--- a/configure.in
+++ b/configure.in
@@ -223,6 +223,7 @@ precode='#include <sys/types.h>
 #include <sys/ioctl.h>
 #include <sys/file.h>
 #include <signal.h>
+#include <stdlib.h>
 
 typedef void (*sighandler_t)(int);
 sighandler_t signal(int signum, sighandler_t handler);