summaryrefslogtreecommitdiff
blob: 5d40e5ddf684c727d6eb0d4ec962d23bd44846a4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
From 4c3a5051aa9706eea42dab31f9e121d975c08521 Mon Sep 17 00:00:00 2001
From: Sam James <sam@gentoo.org>
Date: Thu, 17 Nov 2022 20:20:45 +0000
Subject: [PATCH] Fix configure with clang 16

Bug: https://bugs.gentoo.org/881687
Signed-off-by: Sam James <sam@gentoo.org>
--- a/configure.in
+++ b/configure.in
@@ -454,7 +454,7 @@ AC_CHECK_FUNC(siglongjmp, AC_DEFINE(HAVE_SIGLONGJMP))
 # because Unixware 2.0 handles it specially and refuses to compile
 # autoconf's automatic test that is a call with no arguments
 AC_MSG_CHECKING([for memcpy])
-AC_TRY_LINK(,[
+AC_TRY_LINK([#include <string.h>],[
 char *s1, *s2;
 memcpy(s1,s2,0);
 ],
@@ -471,7 +471,7 @@ memcpy(s1,s2,0);
 AC_MSG_CHECKING([if WNOHANG requires _POSIX_SOURCE])
 AC_TRY_RUN([
 #include <sys/wait.h>
-main() {
+int main(void) {
 #ifndef WNOHANG
 	return 0;
 #else
@@ -491,7 +491,7 @@ rm -rf wnohang
 AC_TRY_RUN([
 #include <stdio.h>
 #include <sys/wait.h>
-main() {
+int main(void) {
 #ifdef WNOHANG
 	FILE *fp = fopen("wnohang","w");
 	fprintf(fp,"%d",WNOHANG);
@@ -540,24 +540,23 @@ dnl AC_HEADER_EGREP([(void|sighandler_t).*signal], signal.h, retsigtype=void,AC_
 AC_MSG_CHECKING([if signals need to be re-armed])
 AC_TRY_RUN([
 #include <signal.h>
-#define RETSIGTYPE $retsigtype
-
+#include <stdlib.h>
+#include <sys/wait.h>
+#include <unistd.h>
 int signal_rearms = 0;
 
 RETSIGTYPE
-child_sigint_handler(n)
-int n;
+child_sigint_handler(int n)
 {
 }
 
 RETSIGTYPE
-parent_sigint_handler(n)
-int n;
+parent_sigint_handler(int n)
 {
 signal_rearms++;
 }
 
-main()
+int main(void)
 {
 	signal(SIGINT,parent_sigint_handler);
 
@@ -719,7 +718,8 @@ fi
 AC_MSG_CHECKING([for struct sgttyb])
 AC_TRY_RUN([
 #include <sgtty.h>
-main()
+#include <stdlib.h>
+int main(void)
 {
   struct sgttyb tmp;
   exit(0);
@@ -745,7 +745,8 @@ if test $mach -eq 0 ; then
   # pty_termios.c is set up to handle pty_termio.
   AC_MSG_CHECKING([for struct termio])
   AC_TRY_RUN([#include <termio.h>
-  main()
+  #include <stdlib.h>
+  int main(void)
   {
     struct termio tmp;
     exit(0);
@@ -769,7 +770,8 @@ if test $mach -eq 0 ; then
 #  include <inttypes.h>
 #  endif
 #  include <termios.h>
-  main()
+#  include <stdlib.h>
+  int main(void)
   {
     struct termios tmp;
     exit(0);
@@ -793,7 +795,7 @@ AC_TRY_RUN([
 #include <inttypes.h>
 #endif
 #include <termios.h>
-main() {
+int main(void) {
 #if defined(TCGETS) || defined(TCGETA)
 	return 0;
 #else
@@ -815,7 +817,7 @@ AC_TRY_RUN([
 #include <inttypes.h>
 #endif
 #include <termios.h>
-main() {
+int main(void) {
 #ifdef TIOCGWINSZ
 	return 0;
 #else
@@ -834,7 +836,7 @@ main() {
 AC_MSG_CHECKING([for Cray-style ptys])
 SETUID=":"
 AC_TRY_RUN([
-main(){
+int main(void) {
 #ifdef CRAY
 	return 0;
 #else
@@ -887,9 +889,10 @@ AC_FUNC_SETPGRP
 #
 AC_MSG_CHECKING([for SV-style timezone])
 AC_TRY_RUN([
+#include <stdlib.h>
 extern char *tzname[2];
 extern int daylight;
-main()
+int main(void)
 {
   int *x = &daylight;
   char **y = tzname;
--- a/tclconfig/tcl.m4
+++ b/tclconfig/tcl.m4
@@ -2029,7 +2029,7 @@ AC_DEFUN([TEA_SERIAL_PORT], [
     AC_TRY_RUN([
 #include <termios.h>
 
-int main() {
+int main(void) {
     struct termios t;
     if (tcgetattr(0, &t) == 0) {
 	cfsetospeed(&t, 0);
@@ -2042,7 +2042,7 @@ int main() {
 	AC_TRY_RUN([
 #include <termio.h>
 
-int main() {
+int main(void) {
     struct termio t;
     if (ioctl(0, TCGETA, &t) == 0) {
 	t.c_cflag |= CBAUD | PARENB | PARODD | CSIZE | CSTOPB;
@@ -2055,7 +2055,7 @@ int main() {
 	AC_TRY_RUN([
 #include <sgtty.h>
 
-int main() {
+int main(void) {
     struct sgttyb t;
     if (ioctl(0, TIOCGETP, &t) == 0) {
 	t.sg_ospeed = 0;
@@ -2070,7 +2070,7 @@ int main() {
 #include <termios.h>
 #include <errno.h>
 
-int main() {
+int main(void) {
     struct termios t;
     if (tcgetattr(0, &t) == 0
 	|| errno == ENOTTY || errno == ENXIO || errno == EINVAL) {
@@ -2086,7 +2086,7 @@ int main() {
 #include <termio.h>
 #include <errno.h>
 
-int main() {
+int main(void) {
     struct termio t;
     if (ioctl(0, TCGETA, &t) == 0
 	|| errno == ENOTTY || errno == ENXIO || errno == EINVAL) {
@@ -2101,7 +2101,7 @@ int main() {
 #include <sgtty.h>
 #include <errno.h>
 
-int main() {
+int main(void) {
     struct sgttyb t;
     if (ioctl(0, TIOCGETP, &t) == 0
 	|| errno == ENOTTY || errno == ENXIO || errno == EINVAL) {
@@ -2392,7 +2392,9 @@ AC_DEFUN([TEA_TIME_HANDLER], [
     # (like convex) have timezone functions, etc.
     #
     AC_CACHE_CHECK([long timezone variable], tcl_cv_timezone_long, [
-	AC_TRY_COMPILE([#include <time.h>],
+	AC_TRY_COMPILE([#include <time.h>
+             #include <stdlib.h>
+            ],
 	    [extern long timezone;
 	    timezone += 1;
 	    exit (0);],
@@ -2404,7 +2406,9 @@ AC_DEFUN([TEA_TIME_HANDLER], [
 	# On some systems (eg IRIX 6.2), timezone is a time_t and not a long.
 	#
 	AC_CACHE_CHECK([time_t timezone variable], tcl_cv_timezone_time, [
-	    AC_TRY_COMPILE([#include <time.h>],
+	    AC_TRY_COMPILE([#include <time.h>
+                 #include <stdlib.h>
+                ],
 		[extern time_t timezone;
 		timezone += 1;
 		exit (0);],
@@ -2441,7 +2445,7 @@ AC_DEFUN([TEA_BUGGY_STRTOD], [
 	AC_CACHE_CHECK([for Solaris2.4/Tru64 strtod bugs], tcl_cv_strtod_buggy,[
 	    AC_TRY_RUN([
 		extern double strtod();
-		int main() {
+		int main(void) {
 		    char *infString="Inf", *nanString="NaN", *spaceString=" ";
 		    char *term;
 		    double value;