--- 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 <alloca.h>
+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 <alloca.h>
 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<n;i++){x=up[i];r=x+1;rp[i]=r;}}return c;}
 void f(){static const struct{t1 n;t1 src[9];t1 want[9];}d[]={{1,{0},{1}},};t1 got[9];int i;
@@ -621,6 +633,7 @@
    but that's fine, the offending cc is a native-only compiler so we don't
    have to worry about cross compiling.  */
 
+unsigned long lshift_com (unsigned long *, unsigned long *, long, unsigned);
 unsigned long
 lshift_com (rp, up, n, cnt)
   unsigned long *rp;
@@ -664,6 +677,7 @@
     native-only compiler so we don't have to worry about cross compiling.  */
 
 #include <stdlib.h>
+void lshift_com (unsigned long *, unsigned long *, long, unsigned);
 void
 lshift_com (rp, up, n, cnt)
   unsigned long *rp;
@@ -815,6 +829,7 @@
 [AC_MSG_CHECKING([compiler $1 has long long])
 cat >conftest.c <<EOF
 long long  foo;
+long long  bar ();
 long long  bar () { return foo; }
 int main () { return 0; }
 EOF
@@ -959,6 +974,7 @@
 [echo "Testing gcc GOT with eax emitted" >&AC_FD_CC
 cat >conftest.c <<\EOF
 [int foo;
+int bar ();
 int bar () { return foo; }
 ]EOF
 tmp_got_emitted=no
@@ -1150,7 +1166,7 @@
 [AC_MSG_CHECKING([assembler $1 $2])
 result=no
 cat >conftest.c <<EOF
-int main () {}
+int main () { return 0; }
 EOF
 gmp_compile="$1 $2 -c conftest.c >conftest.out 2>&1"
 if AC_TRY_EVAL(gmp_compile); then
@@ -2509,6 +2525,8 @@
 AC_REQUIRE([AC_PROG_LIBTOOL])
 AC_MSG_CHECKING([how to call x86 mcount])
 cat >conftest.c <<EOF
+void foo ();
+void bar ();
 foo(){bar();}
 EOF
 
@@ -2704,6 +2722,7 @@
 [gmp_cv_asm_powerpc_pic=yes
 cat >conftest.c <<EOF
 int foo;
+int *bar();
 int *bar() { return &foo; }
 EOF
 echo "Test program:" >&AC_FD_CC
@@ -3294,6 +3313,7 @@
      AC_TRY_RUN([
 #include <string.h>  /* for strcmp */
 #include <stdio.h>   /* for vsnprintf */
+#include <stdlib.h>  /* for exit */
 
 #if HAVE_STDARG
 #include <stdarg.h>
@@ -3399,7 +3419,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
 ])
@@ -3576,7 +3596,7 @@
                gmp_cv_c_for_build_ansi,
 [cat >conftest.c <<EOF
 int
-main (int argc, char *argv[])
+main (int argc, char **argv)
 {
   return 0;
 }
