File: 50-gcc-15.patch

package info (click to toggle)
netpipes 4.2-8.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 940 kB
  • sloc: ansic: 11,895; makefile: 353
file content (391 lines) | stat: -rw-r--r-- 10,032 bytes parent folder | download
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
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
Author: Andreas Tille <tille@debian.org>
Last-Update: 2025-08-29
Bug-Debian: https://bugs.debian.org/1097453
Description: Fix build with gcc-15

--- a/common.h
+++ b/common.h
@@ -39,45 +39,45 @@ extern int	nfds;
 extern int	how_shutdown;
 
 /* add a file descriptor to the list */
-void add_fd(/* int fd */);
+void add_fd(int fd);
 
 /* add a file descriptor to the list */
-void reserve_fds(/* int placeholder */);
+void reserve_fds(int placeholder);
 
 /* do the dup from the argument socket to the list of file descriptors,
    perform the requested shutdown... */
-void dup_n(/*int socket */);
+void dup_n(int socket);
 
 /**********************************************************************/
 
-int get_port(/* struct sockaddr_storage * */);
-void set_port(/* struct sockaddr_storage *, int */);
+int get_port(struct sockaddr_storage * );
+void set_port(struct sockaddr_storage *, int );
 
-int name_to_inet_port(/* char* */);
+int name_to_inet_port(char* );
 
 /**********************************************************************/
 
 struct sockaddr_storage ** /* addr_array */
-convert_hostname(/* char *, int * */);
+convert_hostname(char *, int * );
 
 /**********************************************************************/
 
 void
-printhost(/* FILE, struct sockaddr * */);
+printhost(FILE *fp, struct sockaddr *addr);
 
 /**********************************************************************/
 
 int
-bindlocal(/* int, char *, char*, int, int */);
+bindlocal(int, char *, char*, int, int );
 
 /**********************************************************************/
 
 void				/* this is in version.c */
-emit_version(/* char*, int */);
+emit_version(char *progtitle, int beginyear);
 
 				/* this is also in version.c */
 extern char *progname;
-void set_progname(/* char *argv0 */);
+void set_progname(const char *progname);
 
 /* system dependencies */
 
@@ -86,7 +86,7 @@ void set_progname(/* char *argv0 */);
 /* no definition of sys_errlist in errno.h */
 extern char *sys_errlist[];
 
-char * strerror(/*int*/);
+char * strerror(int);
 #endif
 
 #ifdef POSIX_SIG
@@ -102,6 +102,6 @@ char * strerror(/*int*/);
 #define signal(a, b) sigset(a, b)
 #endif
 
-int valid_descriptor(/*int fd */);
+int valid_descriptor(int fd);
 
 #endif /* common_h_ */
--- a/getpeername.c
+++ b/getpeername.c
@@ -20,7 +20,6 @@
 
     */
 
-static char info[] = "getpeername: a network utility for sockets\nWritten 1995-98 by Robert Forsman <thoth@cis.ufl.edu>\n";
 #include	<stdio.h>
 #include	<string.h>
 #include	<errno.h>
@@ -42,12 +41,7 @@ void usage()
     fprintf(stderr, "Usage: %s [ -verbose ] [ fd# ]\n", progname);
 }
 
-int getpeername();
-int getsockname();
-
-int main(argc, argv)
-    int argc;
-    char **argv;
+int main(int argc, char **argv)
 {
     int	i;
     int	peer_not_sock = 1;
@@ -103,8 +97,7 @@ int main(argc, argv)
 #ifndef NOUNIXSOCKETS
 	struct sockaddr_un	*sunp = &saddr.un;
 #endif
-	int	saddrlen = sizeof(saddr);
-	int (*f)();
+	int	(*f)(int, struct sockaddr *restrict, socklen_t *restrict);
 	char	*name;
 
 	if (peer_not_sock) {
@@ -117,7 +110,8 @@ int main(argc, argv)
 
 	memset(&saddr, 0, sizeof(saddr));
 
-	if (0!= f(fd, &saddr, &saddrlen)) {
+	socklen_t saddrlen = sizeof(saddr);
+	if (0!= f(fd, (struct sockaddr *)&saddr, &saddrlen)) {
 	    fprintf(stderr, "%s: get%sname failed on descriptor %d: ", progname, name, fd);
 	    perror("");
 	    exit(1);
--- a/version.c
+++ b/version.c
@@ -28,8 +28,7 @@
 
 char *progname;
 
-void set_progname(argv0)
-     char *argv0;
+void set_progname(char *argv0)
 {
     char	*cp;
     progname = argv0;
@@ -39,9 +38,7 @@ void set_progname(argv0)
 
 /**********************************************************************/
 
-void emit_version(progtitle, beginyear)
-    char *progtitle;
-    int beginyear;
+void emit_version(char *progtitle, int beginyear)
 {
     int	thisyear=1998;
     fprintf(stderr, "%s; of netpipes version 4.2, ", progtitle);
--- a/sockdown.c
+++ b/sockdown.c
@@ -31,15 +31,11 @@ static char info[] = "sockdown: a networ
 #include "common.h"
 
 
-void				/* this is in version.c */
-emit_version(/* char*, int */);
 
 
 extern char *progname;
 
-int main(argc, argv)
-    int	argc;
-    char **argv;
+int main(int argc, char **argv)
 {
     int	fd;
     int	how;
--- a/common.c
+++ b/common.c
@@ -47,8 +47,7 @@ int	fdsize=0;
 
 int how_shutdown = -2;
 
-void add_fd(fd)
-    int	fd;
+void add_fd(int fd)
 {
     if (fds==0) {
 	fds = (int*)malloc(sizeof(*fds)*(fdsize=4));
@@ -67,8 +66,8 @@ void add_fd(fd)
 	dup2(0, fd);
 }
 
-void reserve_fds(placeholder)
-     int	placeholder;	/* I usually pass in 0, assuming that
+void reserve_fds(int placeholder)
+     				/* I usually pass in 0, assuming that
 				   the process will have a stdin, even
 				   if it's attached to /dev/null */
 {
@@ -79,8 +78,7 @@ void reserve_fds(placeholder)
     }
 }
 
-void dup_n(socket)
-    int	socket;
+void dup_n(int socket)
 {
     int	i;
 #if 0
@@ -99,8 +97,7 @@ void dup_n(socket)
 
 /**********************************************************************/
 
-int get_port(ss)
-struct sockaddr_storage *ss;
+int get_port(struct sockaddr_storage *ss)
 /* Extract port number. Return value in host byte order. */
 {
   return ntohs((ss->ss_family == AF_INET6)
@@ -108,9 +105,7 @@ struct sockaddr_storage *ss;
 		: ((struct sockaddr_in *) ss)->sin_port);
 } /* get_port(struct sockaddr_storage *) */
 
-void set_port(ss, port)
-struct sockaddr_storage *ss;
-int port;
+void set_port(struct sockaddr_storage *ss, int port)
 /* Set port number. Input value in host byte order. */
 {
   switch (ss->ss_family) {
@@ -123,8 +118,7 @@ int port;
   }
 } /* set_port(struct sockaddr_storage *, short int) */
 
-int name_to_inet_port(portname)
-char *portname;
+int name_to_inet_port(char *portname)
 /* This procedure converts a character string to a port number.  It looks
    up the service by name and if there is none, then it converts the string
    to a number with sscanf. Return value in host byte order! */
@@ -152,9 +146,7 @@ char *portname;
 }
 
 struct sockaddr_storage ** /* addr_array */
-convert_hostname(name, count_ret)
-    char	*name;
-    int		*count_ret;
+convert_hostname(char *name, int *count_ret)
 {
   //struct hostent	*hp;
   struct addrinfo hints, *ai, *aiptr;
@@ -247,9 +239,7 @@ convert_hostname(name, count_ret)
 
 
 /* print an internet host address prettily */
-void printhost(fp, addr)
-     FILE	*fp;
-     struct sockaddr	*addr;
+void printhost(FILE *fp, struct sockaddr *addr)
 {
   int rc;
   char hostip[INET6_ADDRSTRLEN];
@@ -265,8 +255,7 @@ extern char *sys_errlist[];
 extern int sys_nerr;
 
 char *
-strerror(num)
-     int num;
+strerror(int num)
 {
   static char ebuf[40];		/* overflow this, baby */
   
--- a/hose.c
+++ b/hose.c
@@ -88,17 +88,14 @@ char	*localaddr=NULL;	/* local internet
 extern int	errno;
 
 
-int name_to_inet_port();
+extern int name_to_inet_port(char *);
 
 void usage () {
   fprintf(stderr,"Usage : %s <hostname> <port> (--in|--out|--err|--fd N|--slave|--netslave|--netslave1|--netslave2)+ [--verb(|ose)] [--unix] [--localport <port>] [--localhost <inet-addr>] [--retry n] [--delay n] [--shutdown [r|w][a]] [--noreuseaddr] -[i][o][e][#3[,4[,5...]]][s][v][q][u] [-p <local port>] [-h <local host>] <command> [ args ... ]\n",progname);
 }
 
 
-int setup_socket(hostname,portname, reuseaddr)
-char	*hostname;
-char	*portname;
-int	reuseaddr;
+int setup_socket(char *hostname, char *portname, int reuseaddr)
 
 {
   int	sock = -1;
@@ -227,9 +224,7 @@ int	reuseaddr;
    copy bytes from stdin to the socket and
    copy bytes from the socket to stdout.
    */
-void copyio(sock, aggressive_close)
-    int	sock;
-    int	aggressive_close;
+void copyio(int sock, int aggressive_close)
 {
     fd_set	readfds, writefds;
 #define BSIZE	4096
@@ -348,7 +343,7 @@ void copyio(sock, aggressive_close)
     exit(exitval);
 }
 
-void endjam()
+void endjam(int)
 {
   doflags &= ~DOJAM;
 }
@@ -385,8 +380,7 @@ void flag_err()
 	how_shutdown = 0;
 }
 
-int flag_scan_comma_fds(s)
-    char *s;
+int flag_scan_comma_fds(char *s)
 {
     int	rval=0;
     while (1) {
@@ -413,9 +407,7 @@ int flag_scan_comma_fds(s)
 /**********************************************************************/
 
 
-int main (argc,argv)
-     int argc;
-     char ** argv;
+int main (int argc, char **argv)
      
 {
   int	sock,i;
--- a/timelimit.c
+++ b/timelimit.c
@@ -41,8 +41,7 @@ char *childprogname=0;
 
 int deadchild = 0;
 
-void notice_child()
-
+void notice_child(int)
 {
     deadchild = 1;
 }
@@ -87,9 +86,7 @@ void kill_child(childpid)
     /* it better be dead now */
 }
 
-int main (argc,argv)
-     int argc;
-     char ** argv;
+int main (int argc, char **argv)
      
 {
     int	childpid, timelimit;
--- a/faucet.c
+++ b/faucet.c
@@ -90,7 +90,7 @@ void usage () {
   fprintf(stderr,"Usage : %s <port> (--in|--out|--err|--fd N)+ [--once] [--verb(|ose)] [--quiet] [--unix] [--foreignport <port>] [--foreignhost <inet-addr>] [--localhost <inet-addr>] [--daemon] [--serial] [--shutdown (r|w)] [--pidfile fname] [--noreuseaddr] [--backlog n] -[i][o][e][#3[,4[,5...]]][v][1][q][u][d][s] [-p <foreign port>] [-h <foreign host>] [-H <local host>] command args\n", progname);
 }
 
-void nice_shutdown()
+void nice_shutdown(int)
 /* This procedure gets called when we are killed with one of the reasonable
    signals (TERM, HUP, that kind of thing).  The main while loop then
    terminates and we get a chance to clean up. */
@@ -151,7 +151,7 @@ int	reuseaddr;
 }
 
 
-void waitonchild()
+void waitonchild(int)
 
 {
   int	status;
@@ -287,9 +287,7 @@ int flag_scan_comma_fds(s)
 /**********************************************************************/
 
 
-int main (argc,argv)
-int argc;
-char ** argv;
+int main (int argc, char **argv)
 
 {
   int	rval, i;
--- a/encapsulate.c
+++ b/encapsulate.c
@@ -1274,7 +1274,7 @@ static void main_io_loop(sock_fd)
 
 static int	childpid = -1;
 
-static void waitonchild()
+static void waitonchild(int)
 {
     /* got a SIGCHILD.
        It must be that: */