public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [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
@ 2012-12-29  6:46 Mike Frysinger (vapier)
  0 siblings, 0 replies; only message in thread
From: Mike Frysinger (vapier) @ 2012-12-29  6:46 UTC (permalink / raw
  To: gentoo-commits

vapier      12/12/29 06:46:56

  Added:                15_all_libiberty-headers-1.patch
                        15_all_libiberty-headers-2.patch
                        15_all_libiberty-headers-3.patch
  Log:
  fix all the missing prototype warnings in libiberty/

Revision  Changes    Path
1.1                  src/patchsets/gcc/2.95.3/gentoo/15_all_libiberty-headers-1.patch

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
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

Index: 15_all_libiberty-headers-1.patch
===================================================================
From 8cf9f4c372c8037046f91636fe820278ed3c7935 Mon Sep 17 00:00:00 2001
From: Richard Henderson <rth@redhat.com>
Date: Wed, 14 Jul 1999 17:32:02 +0000
Subject: [PATCH]         * argv.c: Include stdlib.h and string.h instead of  
       prototyping directly.         * choose-temp.c:
 Conditionally include string.h.

---
 libiberty/ChangeLog     | 6 ++++++
 libiberty/argv.c        | 8 ++------
 libiberty/choose-temp.c | 3 +++
 3 files changed, 11 insertions(+), 6 deletions(-)

1999-07-14  Richard Henderson  <rth@cygnus.com>

	* argv.c: Include stdlib.h and string.h instead of
	prototyping directly.
	* choose-temp.c: Conditionally include string.h.

diff --git a/libiberty/argv.c b/libiberty/argv.c
index 85c17e9..f596ffd 100644
--- a/libiberty/argv.c
+++ b/libiberty/argv.c
@@ -35,12 +35,8 @@ Boston, MA 02111-1307, USA.  */
 #ifdef __STDC__
 
 #include <stddef.h>
-extern void *memcpy (void *s1, const void *s2, size_t n);	/* 4.11.2.1 */
-extern size_t strlen (const char *s);				/* 4.11.6.3 */
-extern void *malloc (size_t size);				/* 4.10.3.3 */
-extern void *realloc (void *ptr, size_t size);			/* 4.10.3.4 */
-extern void free (void *ptr);					/* 4.10.3.2 */
-extern char *strdup (const char *s);				/* Non-ANSI */
+#include <string.h>
+#include <stdlib.h>
 
 #else	/* !__STDC__ */
 
diff --git a/libiberty/choose-temp.c b/libiberty/choose-temp.c
index 49c7386..7aae318 100644
--- a/libiberty/choose-temp.c
+++ b/libiberty/choose-temp.c
@@ -34,6 +34,9 @@ Boston, MA 02111-1307, USA.  */
 #ifdef HAVE_STDLIB_H
 #include <stdlib.h>
 #endif
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
 #ifdef HAVE_SYS_FILE_H
 #include <sys/file.h>   /* May get R_OK, etc. on some systems.  */
 #endif
-- 
1.8.0




1.1                  src/patchsets/gcc/2.95.3/gentoo/15_all_libiberty-headers-2.patch

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
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

Index: 15_all_libiberty-headers-2.patch
===================================================================
From 317ab997bf9870b2d90fb92db665a799d9e03120 Mon Sep 17 00:00:00 2001
From: zack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Mon, 29 May 2000 19:33:52 +0000
Subject: [PATCH] 	* hashtab.c, partition.c, sort.c, xmemdup.c: Include
 string.h 	if HAVE_STRING_H. 	* pexecute.c,
 xexit.c: Include stdlib.h if HAVE_STDLIB_H. 	*
 objalloc.c: Include config.h.  Include stdlib.h and don't 
 declare malloc or free if HAVE_STDLIB_H. 	*
 strerror.c, strsignal.c: Include stdlib.h if HAVE_STDLIB_H,
 	else declare malloc without prototype.  Include
 string.h if 	HAVE_STRING_H, else declare memset without
 prototype.  Don't 	include stddef.h.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@34254 138bc75d-0d04-0410-961f-82ee72b054a4
---
 libiberty/ChangeLog   | 12 ++++++++++++
 libiberty/hashtab.c   |  4 ++++
 libiberty/objalloc.c  |  7 +++++++
 libiberty/partition.c |  4 ++++
 libiberty/pexecute.c  |  3 +++
 libiberty/sort.c      |  3 +++
 libiberty/strerror.c  | 19 +++++++++++--------
 libiberty/strsignal.c | 19 +++++++++++--------
 libiberty/xexit.c     |  3 +++
 libiberty/xmemdup.c   |  3 +++
 10 files changed, 61 insertions(+), 16 deletions(-)

2000-05-29  Zack Weinberg  <zack@wolery.cumb.org>

	* hashtab.c, partition.c, sort.c, xmemdup.c: Include string.h
	if HAVE_STRING_H.
	* pexecute.c, xexit.c: Include stdlib.h if HAVE_STDLIB_H.
	* objalloc.c: Include config.h.  Include stdlib.h and don't
	declare malloc or free if HAVE_STDLIB_H.
	* strerror.c, strsignal.c: Include stdlib.h if HAVE_STDLIB_H,
	else declare malloc without prototype.  Include string.h if
	HAVE_STRING_H, else declare memset without prototype.  Don't
	include stddef.h.

diff --git a/libiberty/objalloc.c b/libiberty/objalloc.c
index 57754a8..5099569 100644
--- a/libiberty/objalloc.c
+++ b/libiberty/objalloc.c
@@ -18,6 +18,8 @@ Foundation, 59 Temple Place - Suite 330,
 Boston, MA 02111-1307, USA.  */
 
 #include "ansidecl.h"
+#include "config.h"
+
 #include "objalloc.h"
 
 /* Get a definition for NULL.  */
@@ -33,11 +35,16 @@ Boston, MA 02111-1307, USA.  */
 #include <stddef.h>
 #endif
 
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#else
 /* For systems with larger pointers than ints, this must be declared.  */
 extern PTR malloc PARAMS ((size_t));
 extern void free PARAMS ((PTR));
 #endif
 
+#endif
+
 /* These routines allocate space for an object.  Freeing allocated
    space may or may not free all more recently allocated space.
 
diff --git a/libiberty/pexecute.c b/libiberty/pexecute.c
index 56ddec7..f1aea9d 100644
--- a/libiberty/pexecute.c
+++ b/libiberty/pexecute.c
@@ -35,6 +35,9 @@ Boston, MA 02111-1307, USA.  */
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
 #define ISSPACE (x) isspace(x)
 #ifdef HAVE_SYS_WAIT_H
 #include <sys/wait.h>
diff --git a/libiberty/strerror.c b/libiberty/strerror.c
index 644cc75..0dd2220 100644
--- a/libiberty/strerror.c
+++ b/libiberty/strerror.c
@@ -25,14 +25,17 @@
 
 /*  Routines imported from standard C runtime libraries. */
 
-#ifdef __STDC__
-#include <stddef.h>
-extern void *malloc (size_t size);				/* 4.10.3.3 */
-extern void *memset (void *s, int c, size_t n);			/* 4.11.6.1 */
-#else	/* !__STDC__ */
-extern char *malloc ();		/* Standard memory allocater */
-extern char *memset ();
-#endif	/* __STDC__ */
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#else
+extern PTR malloc ();
+#endif
+
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+extern PTR memset ();
+#endif
 
 #ifndef MAX
 #  define MAX(a,b) ((a) > (b) ? (a) : (b))
diff --git a/libiberty/strsignal.c b/libiberty/strsignal.c
index c7bb10c..5625323 100644
--- a/libiberty/strsignal.c
+++ b/libiberty/strsignal.c
@@ -23,14 +23,17 @@
 
 /*  Routines imported from standard C runtime libraries. */
 
-#ifdef __STDC__
-#include <stddef.h>
-extern void *malloc (size_t size);				/* 4.10.3.3 */
-extern void *memset (void *s, int c, size_t n);			/* 4.11.6.1 */
-#else	/* !__STDC__ */
-extern char *malloc ();		/* Standard memory allocater */
-extern char *memset ();
-#endif	/* __STDC__ */
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#else
+extern PTR malloc ();
+#endif
+
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+extern PTR memset ();
+#endif
 
 /* Undefine the macro we used to hide the definition of sys_siglist
    found in the system header files.  */
diff --git a/libiberty/xexit.c b/libiberty/xexit.c
index 431bbe0..7aa52ac 100644
--- a/libiberty/xexit.c
+++ b/libiberty/xexit.c
@@ -21,6 +21,9 @@ Boston, MA 02111-1307, USA.  */
 #include "libiberty.h"
 
 #include <stdio.h>
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
 
 /* This variable is set by xatexit if it is called.  This way, xmalloc
    doesn't drag xatexit into the link.  */
-- 
1.8.0




1.1                  src/patchsets/gcc/2.95.3/gentoo/15_all_libiberty-headers-3.patch

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
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

Index: 15_all_libiberty-headers-3.patch
===================================================================
From bb37062f41610518ad294049736488e122906ea6 Mon Sep 17 00:00:00 2001
From: ghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Fri, 21 Jul 2000 20:08:36 +0000
Subject: [PATCH] Warning fixes:

	* cp-demangle.c (cp_demangle_type): Wrap in IN_LIBGCC2.

	* setenv.c (setenv): Initialize variable `ep'.

	* sigsetmask.c (abort): Prototype.

	* vasprintf.c: Include config.h.  Check ANSI_PROTOTYPES, not
	__STDC__ for stdarg.h include.
	(int_vasprintf): Prototype.
	(checkit): Prototype.  Use VPARAMS/ANSI_PROTOTYPES/VA_START in
	definition.  Cast `global_total_width' in comparison.
	(main): Prototype.  Return a value.

	* vfork.c (fork): Prototype.

	* xexit.c: Include config.h.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@35178 138bc75d-0d04-0410-961f-82ee72b054a4
---
 libiberty/ChangeLog     | 19 +++++++++++++++++
 libiberty/cp-demangle.c |  6 +++---
 libiberty/setenv.c      |  2 +-
 libiberty/sigsetmask.c  |  2 ++
 libiberty/vasprintf.c   | 54 ++++++++++++++++++++++++++++++-------------------
 libiberty/vfork.c       |  4 ++++
 libiberty/xexit.c       |  8 +++++---
 7 files changed, 67 insertions(+), 28 deletions(-)

2000-07-21  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>

	* cp-demangle.c (cp_demangle_type): Wrap in IN_LIBGCC2.

	* setenv.c (setenv): Initialize variable `ep'.

	* sigsetmask.c (abort): Prototype.

	* vasprintf.c: Include config.h.  Check ANSI_PROTOTYPES, not
	__STDC__ for stdarg.h include.
	(int_vasprintf): Prototype.
	(checkit): Prototype.  Use VPARAMS/ANSI_PROTOTYPES/VA_START in
	definition.  Cast `global_total_width' in comparison.
	(main): Prototype.  Return a value.

	* vfork.c (fork): Prototype.

	* xexit.c: Include config.h.

diff --git a/libiberty/setenv.c b/libiberty/setenv.c
index a90c83a..f025716 100644
--- a/libiberty/setenv.c
+++ b/libiberty/setenv.c
@@ -63,7 +63,7 @@ setenv (name, value, replace)
      const char *value;
      int replace;
 {
-  register char **ep;
+  register char **ep = 0;
   register size_t size;
   const size_t namelen = strlen (name);
   const size_t vallen = strlen (value) + 1;
diff --git a/libiberty/sigsetmask.c b/libiberty/sigsetmask.c
index 2a09e6a..db6408d 100644
--- a/libiberty/sigsetmask.c
+++ b/libiberty/sigsetmask.c
@@ -12,6 +12,8 @@
 #include <sys/types.h>
 #include <signal.h>
 
+extern void abort PARAMS ((void)) ATTRIBUTE_NORETURN;
+
 #ifdef SIG_SETMASK
 int
 DEFUN(sigsetmask,(set),
diff --git a/libiberty/vasprintf.c b/libiberty/vasprintf.c
index b959f5f..c34585d 100644
--- a/libiberty/vasprintf.c
+++ b/libiberty/vasprintf.c
@@ -18,21 +18,31 @@ License along with libiberty; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 Boston, MA 02111-1307, USA.  */
 
-#ifdef __STDC__
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+#include <ansidecl.h>
+#ifdef ANSI_PROTOTYPES
 #include <stdarg.h>
 #else
 #include <varargs.h>
 #endif
 #include <stdio.h>
 #include <string.h>
-#include <ansidecl.h>
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#else
+extern unsigned long strtoul ();
+extern PTR malloc ();
+#endif
+#include "libiberty.h"
 
 #ifdef TEST
 int global_total_width;
 #endif
 
-unsigned long strtoul ();
-char *malloc ();
+
+static int int_vasprintf PARAMS ((char **, const char *, va_list *));
 
 static int
 int_vasprintf (result, format, args)
@@ -60,7 +70,7 @@ int_vasprintf (result, format, args)
 	      total_width += abs (va_arg (ap, int));
 	    }
 	  else
-	    total_width += strtoul (p, &p, 10);
+	    total_width += strtoul (p, (char **) &p, 10);
 	  if (*p == '.')
 	    {
 	      ++p;
@@ -70,7 +80,7 @@ int_vasprintf (result, format, args)
 		  total_width += abs (va_arg (ap, int));
 		}
 	      else
-	      total_width += strtoul (p, &p, 10);
+	      total_width += strtoul (p, (char **) &p, 10);
 	    }
 	  while (strchr ("hlL", *p))
 	    ++p;
@@ -132,33 +142,33 @@ vasprintf (result, format, args)
 }
 
 #ifdef TEST
-void
-checkit
-#ifdef __STDC__
-     (const char* format, ...)
-#else
-     (va_alist)
-     va_dcl
-#endif
+static void checkit PARAMS ((const char *, ...));
+
+static void
+checkit VPARAMS ((const char* format, ...))
 {
   va_list args;
   char *result;
+#ifndef ANSI_PROTOTYPES
+  const char *format;
+#endif
 
-#ifdef __STDC__
-  va_start (args, format);
-#else
-  char *format;
-  va_start (args);
-  format = va_arg (args, char *);
+  VA_START (args, format);
+
+#ifndef ANSI_PROTOTYPES
+  format = va_arg (args, const char *);
 #endif
+
   vasprintf (&result, format, args);
-  if (strlen (result) < global_total_width)
+  if (strlen (result) < (size_t) global_total_width)
     printf ("PASS: ");
   else
     printf ("FAIL: ");
   printf ("%d %s\n", global_total_width, result);
 }
 
+extern int main PARAMS ((void));
+
 int
 main ()
 {
@@ -169,5 +179,7 @@ main ()
   checkit ("%s", "jjjjjjjjjiiiiiiiiiiiiiiioooooooooooooooooppppppppppppaa\n\
 777777777777777777333333333333366666666666622222222222777777777777733333");
   checkit ("%f%s%d%s", 1.0, "foo", 77, "asdjffffffffffffffiiiiiiiiiiixxxxx");
+
+  return 0;
 }
 #endif /* TEST */
diff --git a/libiberty/vfork.c b/libiberty/vfork.c
index 86c4591..5e877210 100644
--- a/libiberty/vfork.c
+++ b/libiberty/vfork.c
@@ -1,6 +1,10 @@
 /* Emulate vfork using just plain fork, for systems without a real vfork.
    This function is in the public domain. */
 
+#include "ansidecl.h"
+
+extern int fork PARAMS ((void));
+
 int
 vfork ()
 {
diff --git a/libiberty/xexit.c b/libiberty/xexit.c
index 7aa52ac..e8b1ed1 100644
--- a/libiberty/xexit.c
+++ b/libiberty/xexit.c
@@ -17,13 +17,15 @@ License along with libiberty; see the file COPYING.LIB.  If not, write
 to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 Boston, MA 02111-1307, USA.  */
 
-#include "ansidecl.h"
-#include "libiberty.h"
-
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
 #include <stdio.h>
 #ifdef HAVE_STDLIB_H
 #include <stdlib.h>
 #endif
+#include "libiberty.h"
+
 
 /* This variable is set by xatexit if it is called.  This way, xmalloc
    doesn't drag xatexit into the link.  */
-- 
1.8.0






^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2012-12-29  6:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-29  6:46 [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 Mike Frysinger (vapier)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox