$NetBSD: patch-src_autoconf,v 1.1 2024/07/31 22:31:50 vins Exp $

Fix build with gcc-14

--- src/autoconf.orig	2022-03-02 09:52:56.000000000 +0000
+++ src/autoconf
@@ -416,6 +416,12 @@ cat >_autotst.c <<HERE
 int dolock,child[NR_of_forks],timeout,fdcollect;
 char dirlocktest[]="_locktest";
 
+#include <stdlib.h>
+int killchildren();
+int fdlock(int fd);
+int sfdlock(int fd);
+int fdunlock();
+
 void stimeout()
 { timeout=1;close(fdcollect);killchildren();
 }
@@ -437,7 +443,7 @@ unsigned sfork()
   return pid;
 }
 
-int main(argc,argv)char*argv[];
+int main(int argc,char*argv[])
 { int goodlock,testlock,i,pip[2],pipw[2];time_t otimet;unsigned dtimet;
   static char filename[]="_locktst.l0";
   close(0);goodlock=0;testlock=FIRST_lock;signal(SIGPIPE,SIG_DFL);
@@ -587,13 +593,13 @@ int killchildren()
   return 0;
 }
 
-int sfdlock(fd)
+int sfdlock(int fd)
 { int i;unsigned gobble[GOBBLE>>2];
   for(i=GOBBLE>>2;i;gobble[--i]=~(unsigned)0);		 /* SunOS crash test */
   return fdlock(fd);
 }
 
-static oldfdlock;
+static int oldfdlock;
 #ifdef F_SETLKW
 static struct flock flck;		/* why can't it be a local variable? */
 #endif
@@ -601,7 +607,7 @@ static struct flock flck;		/* why can't 
 static off_t oldlockoffset;
 #endif
 
-int fdlock(fd)
+int fdlock(int fd)
 { int i;unsigned gobble[GOBBLE>>2];
   for(i=GOBBLE>>2;i;gobble[--i]=~(unsigned)0);		 /* SunOS crash test */
   oldfdlock=fd;fd=0;
@@ -997,11 +1003,11 @@ int main(){int i;i=1;
  i+=WIFEXITED(i);
  i+=WIFSTOPPED(i);
  i+=WEXITSTATUS(i);
- i+=WSIGTERM(i);
+ i+=WTERMSIG(i);
  return i;}
 HERE
 
-echo 'Testing for WIFEXITED(), WIFSTOPPED(), WEXITSTATUS() & WSIGTERM()'
+echo 'Testing for WIFEXITED(), WIFSTOPPED(), WEXITSTATUS() & WTERMSIG()'
 if $MAKE _autotst.$O >_autotst.rrr 2>&1
 then
    $FGREP -v include/ <_autotst.rrr >_autotst.$O
@@ -1033,6 +1039,8 @@ cat >_autotst.c <<HERE
 #ifndef NO_COMSAT
 #include "network.h"
 #endif
+int setrgid();
+int setresgid();
 int main(){char a[2];
  endpwent();endgrent();memmove(a,"0",1);bcopy("0",a,1);strcspn(a,"0");
  strtol("0",(char**)0,10);strchr("0",'0');strpbrk(a,"0");rename(a,"0");
@@ -1059,7 +1067,7 @@ echo 'Testing for memmove, strchr, strpb
 echo '	rename, setrgid, setegid, pow, opendir, mkdir, waitpid, fsync,'
 echo '	ftruncate, strtod, strncasecmp, strerror, strlcat,'
 echo '	memset, bzero, and _exit'
-if $MAKE _autotst.$O >$DEVNULL 2>&1
+if $MAKE _autotst.$O >_autotst.rrr 2>&1
 then
 :
 else
@@ -1201,7 +1209,7 @@ unsigned long dobench(strstr,iter,haysta
   return (unsigned long)clock()-to;
 }
 #endif
-int main(argc,argv)int argc;const char*argv[];
+int main(int argc,const char*argv[])
 { if(argc==1)
    { char*haystack;
 #ifdef BENCHSIZE
