From f2da81c3a355144597dd3c6cd0b358e0c4cceb79 Mon Sep 17 00:00:00 2001 From: inferl Date: Tue, 12 Nov 2024 17:49:19 +0800 Subject: [PATCH 1/2] fix loop in autoconf volatile --- src/config/autoconf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/config/autoconf b/src/config/autoconf index 8760853..58e48d7 100755 --- a/src/config/autoconf +++ b/src/config/autoconf @@ -84,7 +84,8 @@ while true; do case $? in 100) echo "Your compiler chokes on the \"volatile\" modifier." echo "Never mind, we'll do without it." - volatile="-Dvolatile=";; + volatile="-Dvolatile=" + break;; 0) echo "This architecture has no alignment constraints." echo "#undef ALIGNMENT" >> m.h break;; From d620b319e0f2e08da968bfc0f2d2cb393ca4afe4 Mon Sep 17 00:00:00 2001 From: inferl Date: Tue, 12 Nov 2024 19:39:16 +0800 Subject: [PATCH 2/2] fix type decl in autoconf tests --- src/config/auto-aux/align.c | 2 +- src/config/auto-aux/bytecopy.c | 2 +- src/config/auto-aux/dblalign.c | 2 +- src/config/auto-aux/endian.c | 5 +++-- src/config/auto-aux/schar.c | 2 +- src/config/auto-aux/schar2.c | 2 +- src/config/auto-aux/setjmp.c | 3 ++- src/config/auto-aux/sighandler.c | 4 ++-- src/config/auto-aux/signals.c | 1 + src/config/autoconf | 3 +-- 10 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/config/auto-aux/align.c b/src/config/auto-aux/align.c index 87ed378..7b64de6 100644 --- a/src/config/auto-aux/align.c +++ b/src/config/auto-aux/align.c @@ -95,7 +95,7 @@ int speedtest(p) return total; } -main() +int main(int argc, char ** argv) { long n[1001]; int speed_aligned, speed_unaligned; diff --git a/src/config/auto-aux/bytecopy.c b/src/config/auto-aux/bytecopy.c index 08f5628..163f182 100644 --- a/src/config/auto-aux/bytecopy.c +++ b/src/config/auto-aux/bytecopy.c @@ -8,7 +8,7 @@ char buffer[27]; #define cpy copy #endif -main() +int main(int argc, char ** argv) { cpy("abcdefghijklmnopqrstuvwxyz", buffer, 27); if (strcmp(buffer, "abcdefghijklmnopqrstuvwxyz") != 0) exit(1); diff --git a/src/config/auto-aux/dblalign.c b/src/config/auto-aux/dblalign.c index 0557dab..e240275 100644 --- a/src/config/auto-aux/dblalign.c +++ b/src/config/auto-aux/dblalign.c @@ -19,7 +19,7 @@ void sig_handler() longjmp(failure, 1); } -main() +int main(int argc, char ** argv) { #define ARRSIZE 100 long n[ARRSIZE]; diff --git a/src/config/auto-aux/endian.c b/src/config/auto-aux/endian.c index d1d9039..7d807fd 100644 --- a/src/config/auto-aux/endian.c +++ b/src/config/auto-aux/endian.c @@ -1,9 +1,10 @@ #include #include +#include -main() +int main(int argc, char ** argv) { - long n[2]; + int32_t n[2]; char * p; n[0] = 0x41424344; diff --git a/src/config/auto-aux/schar.c b/src/config/auto-aux/schar.c index de11d5e..a8f7a28 100644 --- a/src/config/auto-aux/schar.c +++ b/src/config/auto-aux/schar.c @@ -1,7 +1,7 @@ #include char foo[]="\377"; -main() +int main(int argc, char ** argv) { int i; i = foo[0]; diff --git a/src/config/auto-aux/schar2.c b/src/config/auto-aux/schar2.c index 2e067f2..05816d3 100644 --- a/src/config/auto-aux/schar2.c +++ b/src/config/auto-aux/schar2.c @@ -1,7 +1,7 @@ #include signed char foo[]="\377"; -main() +int main(int argc, char ** argv) { int i; i = foo[0]; diff --git a/src/config/auto-aux/setjmp.c b/src/config/auto-aux/setjmp.c index 0867e62..c41c088 100644 --- a/src/config/auto-aux/setjmp.c +++ b/src/config/auto-aux/setjmp.c @@ -1,6 +1,7 @@ #include +#include -main() +int main(int argc, char ** argv) { jmp_buf buf; int i; diff --git a/src/config/auto-aux/sighandler.c b/src/config/auto-aux/sighandler.c index 7170fe6..23211e3 100644 --- a/src/config/auto-aux/sighandler.c +++ b/src/config/auto-aux/sighandler.c @@ -1,8 +1,8 @@ #include -int main() +int main(int argc, char ** argv) { - SIGRETURN (*old)(); + sig_t old; old = signal(SIGQUIT, SIG_DFL); return 0; } diff --git a/src/config/auto-aux/signals.c b/src/config/auto-aux/signals.c index 17d158f..31ebf6c 100644 --- a/src/config/auto-aux/signals.c +++ b/src/config/auto-aux/signals.c @@ -4,6 +4,7 @@ #include #include +#include int counter; diff --git a/src/config/autoconf b/src/config/autoconf index 58e48d7..8760853 100755 --- a/src/config/autoconf +++ b/src/config/autoconf @@ -84,8 +84,7 @@ while true; do case $? in 100) echo "Your compiler chokes on the \"volatile\" modifier." echo "Never mind, we'll do without it." - volatile="-Dvolatile=" - break;; + volatile="-Dvolatile=";; 0) echo "This architecture has no alignment constraints." echo "#undef ALIGNMENT" >> m.h break;;