diff options
author | Florian Weimer <fweimer@redhat.com> | 2022-10-18 16:58:48 +0200 |
---|---|---|
committer | Florian Weimer <fweimer@redhat.com> | 2022-10-18 16:58:48 +0200 |
commit | 885b6660c17fb91980b5682514ef54668e544b02 (patch) | |
tree | 086df9c132f59edc69de275163858969becac32b /libiberty/configure | |
parent | 6be2672e4ee41c566a9e072088cccca263bab5f7 (diff) | |
download | gcc-885b6660c17fb91980b5682514ef54668e544b02.zip gcc-885b6660c17fb91980b5682514ef54668e544b02.tar.gz gcc-885b6660c17fb91980b5682514ef54668e544b02.tar.bz2 |
libiberty: Fix C89-isms in configure tests
libiberty/
* acinclude.m4 (ac_cv_func_strncmp_works): Add missing
int return type and parameter list to the definition of main.
Include <stdlib.h> and <string.h> for prototypes.
(ac_cv_c_stack_direction): Add missing
int return type and parameter list to the definitions of
main, find_stack_direction. Include <stdlib.h> for exit
prototype.
* configure: Regenerate.
Diffstat (limited to 'libiberty/configure')
-rwxr-xr-x | libiberty/configure | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/libiberty/configure b/libiberty/configure index 65fc500..860f981fa 100755 --- a/libiberty/configure +++ b/libiberty/configure @@ -6784,7 +6784,10 @@ else else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -find_stack_direction () +#include <stdlib.h> + +int +find_stack_direction (void) { static char *addr = 0; auto char dummy; @@ -6796,7 +6799,9 @@ find_stack_direction () else return (&dummy > addr) ? 1 : -1; } -main () + +int +main (void) { exit (find_stack_direction() < 0); } @@ -7621,6 +7626,8 @@ else /* Test by Jim Wilson and Kaveh Ghazi. Check whether strncmp reads past the end of its string parameters. */ +#include <stdlib.h> +#include <string.h> #include <sys/types.h> #ifdef HAVE_FCNTL_H @@ -7648,7 +7655,8 @@ else #define MAP_LEN 0x10000 -main () +int +main (void) { #if defined(HAVE_MMAP) || defined(HAVE_MMAP_ANYWHERE) char *p; |