🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #2982

Re: malloc(0)

#2982
From: Larry Jones
Date: Sun, 22 Nov 1992 16:54
17 lines
1096 bytes
In article <1992Nov21.005207.9741@lucid.com>, jss@lucid.com (Jerry Schwarz) writes:
< The standard says  (refering to allocation routines)
< 
< 	If the size of the space requested is zero, the behavior
< 	is implementation-defined; the value returned shall be
< 	either a null pointer or a unique pointer.
< 
< I have always read "unique pointer" as meaning different from
< previously allocated pointers including pointers previously
< returned by malloc(0).

That was indeed the committee's intent.  If every call for zero space
returned the same pointer it wouldn't be very unique, would it?
----
Larry Jones, SDRC, 2000 Eastman Dr., Milford, OH  45150-2789  513-576-2070
larry.jones@sdrc.com  or  ...uunet!sdrc!larry.jones
It's no fun to play games with a poor sport. -- Calvin
Technical Details
Message-ID: <2305@sdrc.COM>
Path: arc1-ca.pugleaf.net!sparky!uunet!sdrc!thor!scjones
References: <1ejhrnINN5it@ftp.UU.NET> <1992Nov21.005207.9741@lucid.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!sdrc!thor!scjones
From: scjones@thor.sdrc.com (Larry Jones)
Newsgroups: comp.std.c
Subject: Re: malloc(0)
Message-ID: <2305@sdrc.COM>
Date: 22 Nov 92 16:54:09 GMT
References: <1ejhrnINN5it@ftp.UU.NET> <1992Nov21.005207.9741@lucid.com>
Sender: news@sdrc.COM
Lines: 17