Gentoo Archives: gentoo-commits

From: "Mike Frysinger (vapier)" <vapier@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo commit in src/patchsets/gcc/2.95.3/gentoo: 15_all_libiberty-headers-1.patch 15_all_libiberty-headers-2.patch 15_all_libiberty-headers-3.patch
Date: Sat, 29 Dec 2012 06:47:14
Message-Id: 20121229064656.BF0F22171D@flycatcher.gentoo.org
1 vapier 12/12/29 06:46:56
2
3 Added: 15_all_libiberty-headers-1.patch
4 15_all_libiberty-headers-2.patch
5 15_all_libiberty-headers-3.patch
6 Log:
7 fix all the missing prototype warnings in libiberty/
8
9 Revision Changes Path
10 1.1 src/patchsets/gcc/2.95.3/gentoo/15_all_libiberty-headers-1.patch
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/2.95.3/gentoo/15_all_libiberty-headers-1.patch?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/2.95.3/gentoo/15_all_libiberty-headers-1.patch?rev=1.1&content-type=text/plain
14
15 Index: 15_all_libiberty-headers-1.patch
16 ===================================================================
17 From 8cf9f4c372c8037046f91636fe820278ed3c7935 Mon Sep 17 00:00:00 2001
18 From: Richard Henderson <rth@××××××.com>
19 Date: Wed, 14 Jul 1999 17:32:02 +0000
20 Subject: [PATCH] * argv.c: Include stdlib.h and string.h instead of
21 prototyping directly. * choose-temp.c:
22 Conditionally include string.h.
23
24 ---
25 libiberty/ChangeLog | 6 ++++++
26 libiberty/argv.c | 8 ++------
27 libiberty/choose-temp.c | 3 +++
28 3 files changed, 11 insertions(+), 6 deletions(-)
29
30 1999-07-14 Richard Henderson <rth@××××××.com>
31
32 * argv.c: Include stdlib.h and string.h instead of
33 prototyping directly.
34 * choose-temp.c: Conditionally include string.h.
35
36 diff --git a/libiberty/argv.c b/libiberty/argv.c
37 index 85c17e9..f596ffd 100644
38 --- a/libiberty/argv.c
39 +++ b/libiberty/argv.c
40 @@ -35,12 +35,8 @@ Boston, MA 02111-1307, USA. */
41 #ifdef __STDC__
42
43 #include <stddef.h>
44 -extern void *memcpy (void *s1, const void *s2, size_t n); /* 4.11.2.1 */
45 -extern size_t strlen (const char *s); /* 4.11.6.3 */
46 -extern void *malloc (size_t size); /* 4.10.3.3 */
47 -extern void *realloc (void *ptr, size_t size); /* 4.10.3.4 */
48 -extern void free (void *ptr); /* 4.10.3.2 */
49 -extern char *strdup (const char *s); /* Non-ANSI */
50 +#include <string.h>
51 +#include <stdlib.h>
52
53 #else /* !__STDC__ */
54
55 diff --git a/libiberty/choose-temp.c b/libiberty/choose-temp.c
56 index 49c7386..7aae318 100644
57 --- a/libiberty/choose-temp.c
58 +++ b/libiberty/choose-temp.c
59 @@ -34,6 +34,9 @@ Boston, MA 02111-1307, USA. */
60 #ifdef HAVE_STDLIB_H
61 #include <stdlib.h>
62 #endif
63 +#ifdef HAVE_STRING_H
64 +#include <string.h>
65 +#endif
66 #ifdef HAVE_SYS_FILE_H
67 #include <sys/file.h> /* May get R_OK, etc. on some systems. */
68 #endif
69 --
70 1.8.0
71
72
73
74
75 1.1 src/patchsets/gcc/2.95.3/gentoo/15_all_libiberty-headers-2.patch
76
77 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/2.95.3/gentoo/15_all_libiberty-headers-2.patch?rev=1.1&view=markup
78 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/2.95.3/gentoo/15_all_libiberty-headers-2.patch?rev=1.1&content-type=text/plain
79
80 Index: 15_all_libiberty-headers-2.patch
81 ===================================================================
82 From 317ab997bf9870b2d90fb92db665a799d9e03120 Mon Sep 17 00:00:00 2001
83 From: zack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>
84 Date: Mon, 29 May 2000 19:33:52 +0000
85 Subject: [PATCH] * hashtab.c, partition.c, sort.c, xmemdup.c: Include
86 string.h if HAVE_STRING_H. * pexecute.c,
87 xexit.c: Include stdlib.h if HAVE_STDLIB_H. *
88 objalloc.c: Include config.h. Include stdlib.h and don't
89 declare malloc or free if HAVE_STDLIB_H. *
90 strerror.c, strsignal.c: Include stdlib.h if HAVE_STDLIB_H,
91 else declare malloc without prototype. Include
92 string.h if HAVE_STRING_H, else declare memset without
93 prototype. Don't include stddef.h.
94
95 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@34254 138bc75d-0d04-0410-961f-82ee72b054a4
96 ---
97 libiberty/ChangeLog | 12 ++++++++++++
98 libiberty/hashtab.c | 4 ++++
99 libiberty/objalloc.c | 7 +++++++
100 libiberty/partition.c | 4 ++++
101 libiberty/pexecute.c | 3 +++
102 libiberty/sort.c | 3 +++
103 libiberty/strerror.c | 19 +++++++++++--------
104 libiberty/strsignal.c | 19 +++++++++++--------
105 libiberty/xexit.c | 3 +++
106 libiberty/xmemdup.c | 3 +++
107 10 files changed, 61 insertions(+), 16 deletions(-)
108
109 2000-05-29 Zack Weinberg <zack@×××××××××××.org>
110
111 * hashtab.c, partition.c, sort.c, xmemdup.c: Include string.h
112 if HAVE_STRING_H.
113 * pexecute.c, xexit.c: Include stdlib.h if HAVE_STDLIB_H.
114 * objalloc.c: Include config.h. Include stdlib.h and don't
115 declare malloc or free if HAVE_STDLIB_H.
116 * strerror.c, strsignal.c: Include stdlib.h if HAVE_STDLIB_H,
117 else declare malloc without prototype. Include string.h if
118 HAVE_STRING_H, else declare memset without prototype. Don't
119 include stddef.h.
120
121 diff --git a/libiberty/objalloc.c b/libiberty/objalloc.c
122 index 57754a8..5099569 100644
123 --- a/libiberty/objalloc.c
124 +++ b/libiberty/objalloc.c
125 @@ -18,6 +18,8 @@ Foundation, 59 Temple Place - Suite 330,
126 Boston, MA 02111-1307, USA. */
127
128 #include "ansidecl.h"
129 +#include "config.h"
130 +
131 #include "objalloc.h"
132
133 /* Get a definition for NULL. */
134 @@ -33,11 +35,16 @@ Boston, MA 02111-1307, USA. */
135 #include <stddef.h>
136 #endif
137
138 +#ifdef HAVE_STDLIB_H
139 +#include <stdlib.h>
140 +#else
141 /* For systems with larger pointers than ints, this must be declared. */
142 extern PTR malloc PARAMS ((size_t));
143 extern void free PARAMS ((PTR));
144 #endif
145
146 +#endif
147 +
148 /* These routines allocate space for an object. Freeing allocated
149 space may or may not free all more recently allocated space.
150
151 diff --git a/libiberty/pexecute.c b/libiberty/pexecute.c
152 index 56ddec7..f1aea9d 100644
153 --- a/libiberty/pexecute.c
154 +++ b/libiberty/pexecute.c
155 @@ -35,6 +35,9 @@ Boston, MA 02111-1307, USA. */
156 #ifdef HAVE_UNISTD_H
157 #include <unistd.h>
158 #endif
159 +#ifdef HAVE_STDLIB_H
160 +#include <stdlib.h>
161 +#endif
162 #define ISSPACE (x) isspace(x)
163 #ifdef HAVE_SYS_WAIT_H
164 #include <sys/wait.h>
165 diff --git a/libiberty/strerror.c b/libiberty/strerror.c
166 index 644cc75..0dd2220 100644
167 --- a/libiberty/strerror.c
168 +++ b/libiberty/strerror.c
169 @@ -25,14 +25,17 @@
170
171 /* Routines imported from standard C runtime libraries. */
172
173 -#ifdef __STDC__
174 -#include <stddef.h>
175 -extern void *malloc (size_t size); /* 4.10.3.3 */
176 -extern void *memset (void *s, int c, size_t n); /* 4.11.6.1 */
177 -#else /* !__STDC__ */
178 -extern char *malloc (); /* Standard memory allocater */
179 -extern char *memset ();
180 -#endif /* __STDC__ */
181 +#ifdef HAVE_STDLIB_H
182 +#include <stdlib.h>
183 +#else
184 +extern PTR malloc ();
185 +#endif
186 +
187 +#ifdef HAVE_STRING_H
188 +#include <string.h>
189 +#else
190 +extern PTR memset ();
191 +#endif
192
193 #ifndef MAX
194 # define MAX(a,b) ((a) > (b) ? (a) : (b))
195 diff --git a/libiberty/strsignal.c b/libiberty/strsignal.c
196 index c7bb10c..5625323 100644
197 --- a/libiberty/strsignal.c
198 +++ b/libiberty/strsignal.c
199 @@ -23,14 +23,17 @@
200
201 /* Routines imported from standard C runtime libraries. */
202
203 -#ifdef __STDC__
204 -#include <stddef.h>
205 -extern void *malloc (size_t size); /* 4.10.3.3 */
206 -extern void *memset (void *s, int c, size_t n); /* 4.11.6.1 */
207 -#else /* !__STDC__ */
208 -extern char *malloc (); /* Standard memory allocater */
209 -extern char *memset ();
210 -#endif /* __STDC__ */
211 +#ifdef HAVE_STDLIB_H
212 +#include <stdlib.h>
213 +#else
214 +extern PTR malloc ();
215 +#endif
216 +
217 +#ifdef HAVE_STRING_H
218 +#include <string.h>
219 +#else
220 +extern PTR memset ();
221 +#endif
222
223 /* Undefine the macro we used to hide the definition of sys_siglist
224 found in the system header files. */
225 diff --git a/libiberty/xexit.c b/libiberty/xexit.c
226 index 431bbe0..7aa52ac 100644
227 --- a/libiberty/xexit.c
228 +++ b/libiberty/xexit.c
229 @@ -21,6 +21,9 @@ Boston, MA 02111-1307, USA. */
230 #include "libiberty.h"
231
232 #include <stdio.h>
233 +#ifdef HAVE_STDLIB_H
234 +#include <stdlib.h>
235 +#endif
236
237 /* This variable is set by xatexit if it is called. This way, xmalloc
238 doesn't drag xatexit into the link. */
239 --
240 1.8.0
241
242
243
244
245 1.1 src/patchsets/gcc/2.95.3/gentoo/15_all_libiberty-headers-3.patch
246
247 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/2.95.3/gentoo/15_all_libiberty-headers-3.patch?rev=1.1&view=markup
248 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/2.95.3/gentoo/15_all_libiberty-headers-3.patch?rev=1.1&content-type=text/plain
249
250 Index: 15_all_libiberty-headers-3.patch
251 ===================================================================
252 From bb37062f41610518ad294049736488e122906ea6 Mon Sep 17 00:00:00 2001
253 From: ghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4>
254 Date: Fri, 21 Jul 2000 20:08:36 +0000
255 Subject: [PATCH] Warning fixes:
256
257 * cp-demangle.c (cp_demangle_type): Wrap in IN_LIBGCC2.
258
259 * setenv.c (setenv): Initialize variable `ep'.
260
261 * sigsetmask.c (abort): Prototype.
262
263 * vasprintf.c: Include config.h. Check ANSI_PROTOTYPES, not
264 __STDC__ for stdarg.h include.
265 (int_vasprintf): Prototype.
266 (checkit): Prototype. Use VPARAMS/ANSI_PROTOTYPES/VA_START in
267 definition. Cast `global_total_width' in comparison.
268 (main): Prototype. Return a value.
269
270 * vfork.c (fork): Prototype.
271
272 * xexit.c: Include config.h.
273
274
275 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@35178 138bc75d-0d04-0410-961f-82ee72b054a4
276 ---
277 libiberty/ChangeLog | 19 +++++++++++++++++
278 libiberty/cp-demangle.c | 6 +++---
279 libiberty/setenv.c | 2 +-
280 libiberty/sigsetmask.c | 2 ++
281 libiberty/vasprintf.c | 54 ++++++++++++++++++++++++++++++-------------------
282 libiberty/vfork.c | 4 ++++
283 libiberty/xexit.c | 8 +++++---
284 7 files changed, 67 insertions(+), 28 deletions(-)
285
286 2000-07-21 Kaveh R. Ghazi <ghazi@××××××××××××.edu>
287
288 * cp-demangle.c (cp_demangle_type): Wrap in IN_LIBGCC2.
289
290 * setenv.c (setenv): Initialize variable `ep'.
291
292 * sigsetmask.c (abort): Prototype.
293
294 * vasprintf.c: Include config.h. Check ANSI_PROTOTYPES, not
295 __STDC__ for stdarg.h include.
296 (int_vasprintf): Prototype.
297 (checkit): Prototype. Use VPARAMS/ANSI_PROTOTYPES/VA_START in
298 definition. Cast `global_total_width' in comparison.
299 (main): Prototype. Return a value.
300
301 * vfork.c (fork): Prototype.
302
303 * xexit.c: Include config.h.
304
305 diff --git a/libiberty/setenv.c b/libiberty/setenv.c
306 index a90c83a..f025716 100644
307 --- a/libiberty/setenv.c
308 +++ b/libiberty/setenv.c
309 @@ -63,7 +63,7 @@ setenv (name, value, replace)
310 const char *value;
311 int replace;
312 {
313 - register char **ep;
314 + register char **ep = 0;
315 register size_t size;
316 const size_t namelen = strlen (name);
317 const size_t vallen = strlen (value) + 1;
318 diff --git a/libiberty/sigsetmask.c b/libiberty/sigsetmask.c
319 index 2a09e6a..db6408d 100644
320 --- a/libiberty/sigsetmask.c
321 +++ b/libiberty/sigsetmask.c
322 @@ -12,6 +12,8 @@
323 #include <sys/types.h>
324 #include <signal.h>
325
326 +extern void abort PARAMS ((void)) ATTRIBUTE_NORETURN;
327 +
328 #ifdef SIG_SETMASK
329 int
330 DEFUN(sigsetmask,(set),
331 diff --git a/libiberty/vasprintf.c b/libiberty/vasprintf.c
332 index b959f5f..c34585d 100644
333 --- a/libiberty/vasprintf.c
334 +++ b/libiberty/vasprintf.c
335 @@ -18,21 +18,31 @@ License along with libiberty; see the file COPYING.LIB. If
336 not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
337 Boston, MA 02111-1307, USA. */
338
339 -#ifdef __STDC__
340 +#ifdef HAVE_CONFIG_H
341 +#include "config.h"
342 +#endif
343 +#include <ansidecl.h>
344 +#ifdef ANSI_PROTOTYPES
345 #include <stdarg.h>
346 #else
347 #include <varargs.h>
348 #endif
349 #include <stdio.h>
350 #include <string.h>
351 -#include <ansidecl.h>
352 +#ifdef HAVE_STDLIB_H
353 +#include <stdlib.h>
354 +#else
355 +extern unsigned long strtoul ();
356 +extern PTR malloc ();
357 +#endif
358 +#include "libiberty.h"
359
360 #ifdef TEST
361 int global_total_width;
362 #endif
363
364 -unsigned long strtoul ();
365 -char *malloc ();
366 +
367 +static int int_vasprintf PARAMS ((char **, const char *, va_list *));
368
369 static int
370 int_vasprintf (result, format, args)
371 @@ -60,7 +70,7 @@ int_vasprintf (result, format, args)
372 total_width += abs (va_arg (ap, int));
373 }
374 else
375 - total_width += strtoul (p, &p, 10);
376 + total_width += strtoul (p, (char **) &p, 10);
377 if (*p == '.')
378 {
379 ++p;
380 @@ -70,7 +80,7 @@ int_vasprintf (result, format, args)
381 total_width += abs (va_arg (ap, int));
382 }
383 else
384 - total_width += strtoul (p, &p, 10);
385 + total_width += strtoul (p, (char **) &p, 10);
386 }
387 while (strchr ("hlL", *p))
388 ++p;
389 @@ -132,33 +142,33 @@ vasprintf (result, format, args)
390 }
391
392 #ifdef TEST
393 -void
394 -checkit
395 -#ifdef __STDC__
396 - (const char* format, ...)
397 -#else
398 - (va_alist)
399 - va_dcl
400 -#endif
401 +static void checkit PARAMS ((const char *, ...));
402 +
403 +static void
404 +checkit VPARAMS ((const char* format, ...))
405 {
406 va_list args;
407 char *result;
408 +#ifndef ANSI_PROTOTYPES
409 + const char *format;
410 +#endif
411
412 -#ifdef __STDC__
413 - va_start (args, format);
414 -#else
415 - char *format;
416 - va_start (args);
417 - format = va_arg (args, char *);
418 + VA_START (args, format);
419 +
420 +#ifndef ANSI_PROTOTYPES
421 + format = va_arg (args, const char *);
422 #endif
423 +
424 vasprintf (&result, format, args);
425 - if (strlen (result) < global_total_width)
426 + if (strlen (result) < (size_t) global_total_width)
427 printf ("PASS: ");
428 else
429 printf ("FAIL: ");
430 printf ("%d %s\n", global_total_width, result);
431 }
432
433 +extern int main PARAMS ((void));
434 +
435 int
436 main ()
437 {
438 @@ -169,5 +179,7 @@ main ()
439 checkit ("%s", "jjjjjjjjjiiiiiiiiiiiiiiioooooooooooooooooppppppppppppaa\n\
440 777777777777777777333333333333366666666666622222222222777777777777733333");
441 checkit ("%f%s%d%s", 1.0, "foo", 77, "asdjffffffffffffffiiiiiiiiiiixxxxx");
442 +
443 + return 0;
444 }
445 #endif /* TEST */
446 diff --git a/libiberty/vfork.c b/libiberty/vfork.c
447 index 86c4591..5e877210 100644
448 --- a/libiberty/vfork.c
449 +++ b/libiberty/vfork.c
450 @@ -1,6 +1,10 @@
451 /* Emulate vfork using just plain fork, for systems without a real vfork.
452 This function is in the public domain. */
453
454 +#include "ansidecl.h"
455 +
456 +extern int fork PARAMS ((void));
457 +
458 int
459 vfork ()
460 {
461 diff --git a/libiberty/xexit.c b/libiberty/xexit.c
462 index 7aa52ac..e8b1ed1 100644
463 --- a/libiberty/xexit.c
464 +++ b/libiberty/xexit.c
465 @@ -17,13 +17,15 @@ License along with libiberty; see the file COPYING.LIB. If not, write
466 to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
467 Boston, MA 02111-1307, USA. */
468
469 -#include "ansidecl.h"
470 -#include "libiberty.h"
471 -
472 +#ifdef HAVE_CONFIG_H
473 +#include "config.h"
474 +#endif
475 #include <stdio.h>
476 #ifdef HAVE_STDLIB_H
477 #include <stdlib.h>
478 #endif
479 +#include "libiberty.h"
480 +
481
482 /* This variable is set by xatexit if it is called. This way, xmalloc
483 doesn't drag xatexit into the link. */
484 --
485 1.8.0