changeset 21283:16869cca53ce

configure: Fix some implicit function declarations Some configure tests fail unexpectedly if the compiler flag -Werror=implicit-function-declarations is enabled, which can result in the wrong implementations being used. This compiler flag is now enabled by default in Fedora Rawhide: https://fedoraproject.org/wiki/Changes/Fedora26CFlags <stdlib.h> is needed for exit() <string.h> is needed for strcpy()
author Paul Howarth <paul@city-fan.org>
date Mon, 05 Dec 2016 15:17:30 +0000
parents f1164511f6e5
children 14739e2a8fb3
files configure.ac
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/configure.ac	Wed Dec 07 14:23:12 2016 +0100
+++ b/configure.ac	Mon Dec 05 15:17:30 2016 +0000
@@ -837,6 +837,7 @@
 AC_CACHE_CHECK([whether size_t is signed],i_cv_signed_size_t,[
   AC_RUN_IFELSE([AC_LANG_SOURCE([[
     #include <sys/types.h>
+    #include <stdlib.h>
     int main() {
       /* return 0 if we're signed */
       exit((size_t)(int)-1 <= 0 ? 0 : 1);
@@ -993,6 +994,7 @@
 AC_CACHE_CHECK([whether time_t is signed],i_cv_signed_time_t,[
   AC_RUN_IFELSE([AC_LANG_SOURCE([[
     #include <sys/types.h>
+    #include <stdlib.h>
     int main() {
       /* return 0 if we're signed */
       exit((time_t)(int)-1 <= 0 ? 0 : 1);
@@ -1184,6 +1186,7 @@
     #include <unistd.h>
     #include <fcntl.h>
     #include <sys/mman.h>
+    #include <string.h>
     int main() {
       /* return 0 if we're signed */
       int f = open("conftest.mmap", O_RDWR|O_CREAT|O_TRUNC, 0600);
@@ -1560,6 +1563,7 @@
 AC_CACHE_CHECK([for an implementation of va_copy()],lib_cv_va_copy,[
 	AC_RUN_IFELSE([AC_LANG_SOURCE([[
 	#include <stdarg.h>
+	#include <stdlib.h>
 	void f (int i, ...) {
 	va_list args1, args2;
 	va_start (args1, i);
@@ -1578,6 +1582,7 @@
 AC_CACHE_CHECK([for an implementation of __va_copy()],lib_cv___va_copy,[
 	AC_RUN_IFELSE([AC_LANG_SOURCE([[
 	#include <stdarg.h>
+	#include <stdlib.h>
 	void f (int i, ...) {
 	va_list args1, args2;
 	va_start (args1, i);
@@ -1608,6 +1613,7 @@
 AC_CACHE_CHECK([whether va_lists can be copied by value],lib_cv_va_val_copy,[
 	AC_RUN_IFELSE([AC_LANG_SOURCE([[
 	#include <stdarg.h>
+	#include <stdlib.h>
 	void f (int i, ...) {
 	va_list args1, args2;
 	va_start (args1, i);
@@ -1625,7 +1631,7 @@
 ])
 
 if test "x$lib_cv_va_val_copy" = "xno"; then
-  AC_DEFINE(VA_COPY_AS_ARRAY,1, ['va_lists' cannot be copies as values])
+  AC_DEFINE(VA_COPY_AS_ARRAY,1, ['va_lists' cannot be copied as values])
 fi
 
 dnl * dynamic modules?