malloc protoype in egcs
H.J. Lu
hjl@lucon.org
Mon Sep 22 22:00:00 GMT 1997
In my current prototyping patch, I used
extern GENERIC_PTR xmalloc PROTO((unsigned));
extern GENERIC_PTR xrealloc PROTO((GENERIC_PTR, unsigned));
extern GENERIC_PTR xcalloc PROTO((unsigned, unsigned));
The reasons I used unsigned instead of ssize_t are
1. ssize_t may be available when building gcc.
2. ssize_t may not be correct for the malloc being used.
The drawback is "unsigned" may not be correct either. But we only
need to worry about it in the file where xmalloc/xrealloc/xcalloc
are defined. Unless it is worse than no prototype at all, which is
the case today, I think "unsigned" is a better choice.
Any ideas?
Thanks.
--
H.J. Lu (hjl@gnu.ai.mit.edu)
More information about the Gcc
mailing list