This is the mail archive of the
libc-alpha@cygnus.com
mailing list for the glibc project.
Re: [Andrew Pimlott <pimlott@abel.MATH.HARVARD.EDU>] realloc(p, 0) vs. free
- To: Roland McGrath <roland@frob.com>
- Subject: Re: [Andrew Pimlott <pimlott@abel.MATH.HARVARD.EDU>] realloc(p, 0) vs. free
- From: tb@MIT.EDU (Thomas Bushnell, BSG)
- Date: 29 Apr 1999 10:24:44 -0400
- Cc: Andreas Jaeger <aj@arthur.rhein-neckar.de>, libc-alpha@cygnus.com, Andrew Pimlott <pimlott@abel.MATH.HARVARD.EDU>
- References: <199904281742.NAA01231@baalperazim.frob.com>
Roland McGrath <roland@frob.com> writes:
> The only thing that is optional is whether malloc(0) returns null or
> a block that can be freed.
And let's be clear that while it's permissible under ANSI C for
malloc(0) to return null, any sane system returns a unique pointer
that can be freed.