libiberty/ * acinclude.m4 (check for working strncmp): Add missing int return type and parameter list to the definition of main. Include <string.h> for string functions. Avoid calling undeclared exit function. (stack direction for C alloca): Avoid calling undeclared exit function. * configure: Regenerate.
--- libiberty/acinclude.m4 | 12 +++++++----- libiberty/configure | 12 +++++++----- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/libiberty/acinclude.m4 b/libiberty/acinclude.m4 index 6bd127e9826..6e23ae906fc 100644 --- a/libiberty/acinclude.m4 +++ b/libiberty/acinclude.m4 @@ -24,6 +24,7 @@ AC_CACHE_CHECK([for working strncmp], ac_cv_func_strncmp_works, [AC_TRY_RUN([ /* Test by Jim Wilson and Kaveh Ghazi. Check whether strncmp reads past the end of its string parameters. */ +#include <string.h> #include <sys/types.h> #ifdef HAVE_FCNTL_H @@ -51,7 +52,8 @@ AC_CACHE_CHECK([for working strncmp], ac_cv_func_strncmp_works, #define MAP_LEN 0x10000 -main () +int +main (void) { #if defined(HAVE_MMAP) || defined(HAVE_MMAP_ANYWHERE) char *p; @@ -59,7 +61,7 @@ main () dev_zero = open ("/dev/zero", O_RDONLY); if (dev_zero < 0) - exit (1); + return 1; p = (char *) mmap (0, MAP_LEN, PROT_READ|PROT_WRITE, MAP_ANON|MAP_PRIVATE, dev_zero, 0); @@ -67,7 +69,7 @@ main () p = (char *) mmap (0, MAP_LEN, PROT_READ|PROT_WRITE, MAP_ANON|MAP_PRIVATE, -1, 0); if (p == (char *)-1) - exit (2); + return 2; else { char *string = "__si_type_info"; @@ -79,7 +81,7 @@ main () strncmp (r, q, 14); } #endif /* HAVE_MMAP || HAVE_MMAP_ANYWHERE */ - exit (0); + return 0; } ], ac_cv_func_strncmp_works=yes, ac_cv_func_strncmp_works=no, ac_cv_func_strncmp_works=yes) @@ -171,7 +173,7 @@ AC_CACHE_CHECK(stack direction for C alloca, ac_cv_c_stack_direction, } main () { - exit (find_stack_direction() < 0); + return find_stack_direction() < 0; }], ac_cv_c_stack_direction=1, ac_cv_c_stack_direction=-1, diff --git a/libiberty/configure b/libiberty/configure index 65fc5002002..c871cc559ca 100755 --- a/libiberty/configure +++ b/libiberty/configure @@ -6798,7 +6798,7 @@ find_stack_direction () } main () { - exit (find_stack_direction() < 0); + return find_stack_direction() < 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : @@ -7621,6 +7621,7 @@ else /* Test by Jim Wilson and Kaveh Ghazi. Check whether strncmp reads past the end of its string parameters. */ +#include <string.h> #include <sys/types.h> #ifdef HAVE_FCNTL_H @@ -7648,7 +7649,8 @@ else #define MAP_LEN 0x10000 -main () +int +main (void) { #if defined(HAVE_MMAP) || defined(HAVE_MMAP_ANYWHERE) char *p; @@ -7656,7 +7658,7 @@ main () dev_zero = open ("/dev/zero", O_RDONLY); if (dev_zero < 0) - exit (1); + return 1; p = (char *) mmap (0, MAP_LEN, PROT_READ|PROT_WRITE, MAP_ANON|MAP_PRIVATE, dev_zero, 0); @@ -7664,7 +7666,7 @@ main () p = (char *) mmap (0, MAP_LEN, PROT_READ|PROT_WRITE, MAP_ANON|MAP_PRIVATE, -1, 0); if (p == (char *)-1) - exit (2); + return 2; else { char *string = "__si_type_info"; @@ -7676,7 +7678,7 @@ main () strncmp (r, q, 14); } #endif /* HAVE_MMAP || HAVE_MMAP_ANYWHERE */ - exit (0); + return 0; } _ACEOF base-commit: 54b316ff0d4f3bd823ad0b4d0011900948c5d40e