This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Patch checked in to fix malloc/etc prototypes in system.h
- To: egcs-patches at egcs dot cygnus dot com
- Subject: Patch checked in to fix malloc/etc prototypes in system.h
- From: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- Date: Wed, 8 Sep 1999 15:50:54 -0400 (EDT)
The malloc/etc prototypes installed in system.h from the gcc2
merge conflict with those provided in mips-tdump.c. The former are
extern char* and the latter are extern PTR_T which is conditionally
void*/char* depending on whether a __STDC__ compiler is used.
So I removed the prototypes in mips-tdump.c and fixed the ones in
system.h to use the PTR defined in ansidecl.h (same as PTR_T from
mips-tdump.c.)
While in system.h I fixed sbrk() to use PTR too. I also noticed a
typo in the check for NEED_DECLARATION_REALLOC (was REMALLOC).
The following is the patch I checked in.
--Kaveh
Index: ChangeLog
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/ChangeLog,v
retrieving revision 1.4320
diff -u -p -r1.4320 ChangeLog
--- ChangeLog 1999/09/08 15:44:11 1.4320
+++ ChangeLog 1999/09/08 19:39:18
@@ -1,3 +1,11 @@
+Wed Sep 8 15:32:16 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * system.h (sbrk, malloc, calloc, realloc): Backup prototypes
+ changed from extern char *, to extern PTR. Also fix typo in
+ NEED_DECLARATION_REALLOC test.
+
+ * mips-tdump.c (malloc, calloc, realloc): Don't prototype.
+
Wed Sep 8 11:40:47 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* gansidecl.h (__attribute__, ATTRIBUTE_UNUSED_LABEL,
Index: system.h
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/system.h,v
retrieving revision 1.48
diff -u -p -r1.48 system.h
--- system.h 1999/09/08 07:01:41 1.48
+++ system.h 1999/09/08 19:39:18
@@ -338,7 +338,7 @@ extern char *getwd ();
#endif
#ifdef NEED_DECLARATION_SBRK
-extern char *sbrk ();
+extern PTR sbrk ();
#endif
#ifdef NEED_DECLARATION_STRSTR
@@ -350,15 +350,15 @@ extern char *strstr ();
#endif
#ifdef NEED_DECLARATION_MALLOC
-extern char *malloc ();
+extern PTR malloc ();
#endif
#ifdef NEED_DECLARATION_CALLOC
-extern char *calloc ();
+extern PTR calloc ();
#endif
-#ifdef NEED_DECLARATION_REMALLOC
-extern char *realloc ();
+#ifdef NEED_DECLARATION_REALLOC
+extern PTR realloc ();
#endif
#ifdef HAVE_STRERROR
Index: mips-tdump.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/mips-tdump.c,v
retrieving revision 1.12
diff -u -p -r1.12 mips-tdump.c
--- mips-tdump.c 1999/09/07 05:47:58 1.12
+++ mips-tdump.c 1999/09/08 19:39:19
@@ -262,18 +262,6 @@ const char *glevel_to_string __proto((gl
const char *lang_to_string __proto((lang_t));
const char *type_to_string __proto((AUXU *, int, FDR *));
-#ifndef __alpha
-# ifdef NEED_DECLARATION_MALLOC
-extern PTR_T malloc __proto((size_t));
-# endif
-# ifdef NEED_DECLARATION_CALLOC
-extern PTR_T calloc __proto((size_t, size_t));
-# endif
-# ifdef NEED_DECLARATION_REALLOC
-extern PTR_T realloc __proto((PTR_T, size_t));
-# endif
-#endif
-
extern char *optarg;
extern int optind;
extern int opterr;