This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: libio/dbz won't compile (patch)
- To: zack at wolery dot cumb dot org
- Subject: Re: libio/dbz won't compile (patch)
- From: Mark Mitchell <mark at codesourcery dot com>
- Date: Sun, 23 Jan 2000 11:24:51 -0800
- Cc: gcc-bugs at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org, Ulrich Drepper <drepper at gnu dot org>
- Organization: CodeSourcery, LLC
- References: <20000120103515.D27383@wolery.cumb.org>
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