[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug-gnulib] malloc, realloc patches to assume C89 or better
From: |
Paul Eggert |
Subject: |
[Bug-gnulib] malloc, realloc patches to assume C89 or better |
Date: |
09 Sep 2003 14:58:34 -0700 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 |
I installed this:
2003-09-09 Paul Eggert <address@hidden>
* malloc.c: Include <stdlib.h>, for malloc; don't bother with stddef.h.
rpl_malloc returns void *, not char *.
* realloc.c (rpl_realloc): Likewise. Also, define with a prototype.
Index: lib/malloc.c
===================================================================
RCS file: /cvsroot/gnulib/gnulib/lib/malloc.c,v
retrieving revision 1.5
diff -p -u -r1.5 malloc.c
--- lib/malloc.c 4 Jun 2003 19:22:29 -0000 1.5
+++ lib/malloc.c 9 Sep 2003 21:54:15 -0000
@@ -22,14 +22,12 @@
#endif
#undef malloc
-#include <stddef.h>
-
-char *malloc ();
+#include <stdlib.h>
/* Allocate an N-byte block of memory from the heap.
If N is zero, allocate a 1-byte block. */
-char *
+void *
rpl_malloc (size_t n)
{
if (n == 0)
Index: lib/realloc.c
===================================================================
RCS file: /cvsroot/gnulib/gnulib/lib/realloc.c,v
retrieving revision 1.8
diff -p -u -r1.8 realloc.c
--- lib/realloc.c 16 Aug 2003 03:57:54 -0000 1.8
+++ lib/realloc.c 9 Sep 2003 21:54:15 -0000
@@ -22,19 +22,14 @@
#endif
#undef realloc
-#include <stddef.h>
-
-char *malloc ();
-char *realloc ();
+#include <stdlib.h>
/* Change the size of an allocated block of memory P to N bytes,
with error checking. If N is zero, change it to 1. If P is NULL,
use malloc. */
-char *
-rpl_realloc (p, n)
- char *p;
- size_t n;
+void *
+rpl_realloc (void *p, size_t n)
{
if (n == 0)
n = 1;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Bug-gnulib] malloc, realloc patches to assume C89 or better,
Paul Eggert <=