From 749ef3ca1b138c859553122a9c342e9259cf1e37 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Remco=20R=C4=B3nders?= Date: Mon, 26 Jan 2026 21:00:57 +0000 Subject: [PATCH] Update main() declarations and replace exit() calls with return in Config .c files --- Config | 67 +++++++++++++++++++++++++++++----------------------------- 1 file changed, 34 insertions(+), 33 deletions(-) diff --git a/Config b/Config index 15a09d9..57fc5f5 100755 --- a/Config +++ b/Config @@ -158,7 +158,7 @@ case "$OS" in # New, cleaner detection code. -8/15/99 Sean-Paul Rees (sean@dreamfire.net) cat > $TMP << __EOF__ #include -main() +int main(void) { #ifdef __GLIBC__ printf("%d_%d\n", __GLIBC__, __GLIBC_MINOR__); @@ -166,7 +166,7 @@ main() printf("0\n"); #endif - exit(0); + return 0; } __EOF__ # @@ -254,7 +254,7 @@ echo "Compiler selected: $CCPATH" echo " " # Check it out cat > $TMP <<__EOF__ -main() {} +int main(void) {} __EOF__ $CCPATH $TMP -o $EXEC >/dev/null 2>&1 if [ ! -f $EXEC ] ; then @@ -392,13 +392,13 @@ fi # echo $n "Searching for bcopy/bzero/bcmp...$c" cat > $TMP <<__EOF__ -main() +int main(void) { char a[3], b[3]; bzero(b,3); bcopy(a,b,3); (void)bcmp(a,b,3); - exit(0); + return 0; } __EOF__ $COMP >/dev/null 2>&1 @@ -414,7 +414,7 @@ echo $n "Which one, gettimeofday, or lrand48..$c" cat > $TMP <<__EOF__ #include #include -main() +int main(void) { struct timeval tv; (void) gettimeofday(&tv, NULL); @@ -427,7 +427,7 @@ if [ $? -eq 0 ] ; then else echo "No gettimeofday. Trying lrand48." cat > $TMP <<__EOF__ -main() +int main(void) { int a; a=lrand48(); @@ -453,11 +453,12 @@ cat > $PLATE <<__EOF__ #include #include #include +#include alarmed() { exit(1); } -main() +int main(void) { char b[12], x[32]; int f, l = sizeof(x); @@ -469,7 +470,7 @@ main() alarm(0); exit(0); } - exit(1); + return 1; } __EOF__ sed -e 's/BLOCKING/O_NONBLOCK/' $PLATE > $TMP @@ -515,7 +516,7 @@ echo "Checking if you have 'action from POSIX..." cat > $TMP <<__EOF__ #include -main() +int main(void) { /* poor replacement for NULL but who cares here ? */ sigaction(SIGTERM, (struct sigaction *)0L, (struct sigaction *)0L); } @@ -537,11 +538,11 @@ void handler() kill(getpid(), SIGTERM); sleep(1); } -main() +int main(void) { signal(SIGTERM, handler); kill(getpid(), SIGTERM); - exit (0); + retrun 0; } __EOF__ echo $n "No, but you have...$c" @@ -566,10 +567,10 @@ cat > $TMP <<__EOF__ #ifdef STRINGSH #include #endif -main() +int main(void) { char *s = index("foo", 'o'); - exit(0); + return 0; } __EOF__ $COMP >/dev/null 2>&1 @@ -588,7 +589,7 @@ cat > $TMP <<__EOF__ #include #include #include -main() +int main(void) { struct rusage rus; (void)getrusage(RUSAGE_SELF, &rus); @@ -604,7 +605,7 @@ else #include #include #include -main() +int main(void) { struct tms tmsbuf; (void)times(&tmsbuf); @@ -631,10 +632,10 @@ cat > $TMP <<__EOF__ #ifdef STRINGSH #include #endif -main() +int main(void) { char *s = strcasecmp('a', 'a'); - exit(0); + return 0; } __EOF__ $COMP >/dev/null 2>&1 @@ -648,12 +649,12 @@ fi echo "Checking for additional components..." echo $n "Searching...$c" cat > $TMP <<__EOF__ -main() +int main(void) { unsigned long foo; char *s = strtoul("0x12345", &foo, 16); - exit(0); + return 0; } __EOF__ $COMP >/dev/null 2>&1 @@ -671,10 +672,10 @@ else fi $RM -f $EXEC $TMP cat > $TMP <<__EOF__ -main() +int main(void) { char *s = strerror(0); - exit(0); + return 0; } __EOF__ $COMP >/dev/null 2>&1 @@ -690,10 +691,10 @@ cat > $TMP <<__EOF__ #include #include -main() +int main(void) { dn_skipname("",""); - exit(0); + return 0; } __EOF__ $COMP >/dev/null 2>&1 @@ -709,10 +710,10 @@ fi $RM -f $EXEC $TMP cat > $TMP <<__EOF__ #include -main() +int main(void) { u_int32_t foo; - exit(0); + return 0; } __EOF__ $COMP >/dev/null 2>&1 @@ -738,12 +739,12 @@ cat > $TMP <<__EOF__ #ifdef STRINGSH #include #endif -main() +int main(void) { char t[] = "a", **p = NULL, *s = strtoken(&p, t, ","); if (!strcmp(t, s)) exit(0); - exit(1); + return 1; } __EOF__ $COMP >/dev/null 2>&1 @@ -767,12 +768,12 @@ cat > $TMP <<__EOF__ #ifdef STRINGSH #include #endif -main() +int main(void) { char t[] = "a", *s = strtok(t, ","); if (!strcmp(t, s)) exit(0); - exit(1); + return 1; } __EOF__ $COMP >/dev/null 2>&1 @@ -790,7 +791,7 @@ $RM -f $EXEC $TMP cat > $TMP << __EOF__ #include #include -main() +int main(void) { struct in_addr in; (void)inet_addr("1.2.3.4"); @@ -805,7 +806,7 @@ $RM -f $EXEC $TMP cat > $TMP << __EOF__ #include #include -main() +int main(void) { struct in_addr in; in.s_addr = 0x12345678; @@ -820,7 +821,7 @@ $RM -f $EXEC $TMP cat > $TMP << __EOF__ #include #include -main() +int main(void) { struct in_addr in; in.s_addr = 0x87654321; -- 2.30.2