This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: libio/dbz won't compile (patch)



Zack --
 
  Ulrich has indicated a strong desire to approve all changes to
libio.

  I've copied him on this message so that he can take a look.

  In future, please copy Ulrich on libio patches.

--
Mark Mitchell                   mark@codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com

Recently dbz stopped compiling, which of course aborts 'make check' at
the very beginning of its run.  The problem is a type clash between
its private declaration of malloc() and the standard library.

This patch fixes it for me.  I would call it an obvious bugfix but no
one else has reported this - is it just me?

zw

	* dbz.c, dbzmain.c: Get malloc and friends from stdlib.h if
	__STDC__ is defined.

===================================================================
Index: libio/dbz/dbz.c
--- libio/dbz/dbz.c	1998/02/01 12:20:12	1.2
+++ libio/dbz/dbz.c	2000/01/20 18:34:19
@@ -303,11 +303,15 @@ static int debug;			/* controlled by dbz
 #endif
 
 /* externals used */
+#ifdef __STDC__
+#include <stdlib.h>
+#else
 extern char *malloc();
 extern char *calloc();
 extern void free();		/* ANSI C; some old implementations say int */
 extern int atoi();
 extern long atol();
+#endif
 
 /* misc. forwards */
 static long hash();
===================================================================
Index: libio/dbz/dbzmain.c
--- libio/dbz/dbzmain.c	1999/09/27 17:36:14	1.3
+++ libio/dbz/dbzmain.c	2000/01/20 18:34:19
@@ -74,7 +74,12 @@ extern char *rfc822ize();
 #define	rfc822ize(n)	(n)
 #endif
 
+#ifdef __STDC__
+#include <stdlib.h>
+#else
 extern char *malloc();
+#endif
+
 
 /*
  - main - parse arguments and handle options


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]