--- a/acinclude.m4 +++ b/acinclude.m4 @@ -563,17 +563,26 @@ # __builtin_alloca is not available everywhere, check it exists before # seeing that it works GMP_PROG_CC_WORKS_PART_TEST([$1],[__builtin_alloca availability], -[int k; int foo () { __builtin_alloca (k); }], +[ +#include +int k; +int foo (); +int foo () { __builtin_alloca (k); return 0; } +int main () { return 0; } +], [GMP_PROG_CC_WORKS_PART([$1], [alloca array], [/* The following provokes an internal compiler error from Itanium HP-UX cc under +O2 or higher. We use this sort of code in mpn/generic/mul_fft.c. */ +#include int k; +int foo (); int foo () { int i, **a; a = __builtin_alloca (k); for (i = 0; i <= k; i++) a[i] = __builtin_alloca (1 << i); + return 0; } ])]) @@ -587,6 +596,9 @@ #if defined(__GNUC_STDC_INLINE__) /* e.g. GCC 5.x defaults to this, not __GNUC_GNU_INLINE__ */ extern #endif +t1 e (t2, t2, int, t1); +void g(); +void h(); __inline__ t1 e(t2 rp,t2 up,int n,t1 v0) {t1 c,x,r;int i;if(v0){c=1;for(i=1;i +void lshift_com (unsigned long *, unsigned long *, long, unsigned); void lshift_com (rp, up, n, cnt) unsigned long *rp; @@ -814,6 +830,7 @@ [AC_MSG_CHECKING([compiler $1 has long long]) cat >conftest.c <&AC_FD_CC cat >conftest.c <<\EOF [int foo; +int bar (); int bar () { return foo; } ]EOF tmp_got_emitted=no @@ -1149,7 +1167,7 @@ [AC_MSG_CHECKING([assembler $1 $2]) result=no cat >conftest.c <conftest.c <conftest.c <&AC_FD_CC @@ -3293,6 +3314,7 @@ AC_TRY_RUN([ #include /* for strcmp */ #include /* for vsnprintf */ +#include /* for exit */ #if HAVE_STDARG #include @@ -3337,6 +3359,7 @@ { $i exit (0); + return 0; } ], [:], @@ -3398,7 +3421,7 @@ yes) tmp_inline=inline ;; *) tmp_inline=$ac_cv_c_inline ;; esac - AC_MSG_WARN([mpir.h doesnt recognise compiler "$tmp_inline", inlines will be unavailable])]) + AC_MSG_WARN([mpir.h doesn't recognise compiler "$tmp_inline", inlines will be unavailable])]) ;; esac ]) @@ -3466,10 +3489,12 @@ # remove anything that might look like compiler output to our "||" expression rm -f conftest* a.out b.out a.exe a_out.exe cat >conftest.c < int main () { exit(0); + return 0; } EOF gmp_compile="$1 conftest.c" @@ -3540,10 +3565,12 @@ AC_CACHE_CHECK([for build system executable suffix], gmp_cv_prog_exeext_for_build, [cat >conftest.c < int main () { exit (0); + return 0; } EOF for i in .exe ,ff8 ""; do @@ -3574,10 +3601,12 @@ AC_CACHE_CHECK([whether build system compiler is ANSI], gmp_cv_c_for_build_ansi, [cat >conftest.c < int -main (int argc, char *argv[]) +main (int argc, char **argv) { exit(0); + return 0; } EOF gmp_compile="$CC_FOR_BUILD conftest.c" @@ -3608,10 +3637,13 @@ AC_CACHE_CHECK([for build system compiler math library], gmp_cv_check_libm_for_build, [cat >conftest.c < +#include int main () { exit(0); + return 0; } double d; double