Article View: comp.std.c
Article #5880Re: realloc
From: Jerry Schwarz
Date: Fri, 07 Apr 1989 14:33
Date: Fri, 07 Apr 1989 14:33
21 lines
1243 bytes
1243 bytes
In article <3240@goofy.megatest.UUCP> djones@megatest.UUCP (Dave Jones) writes:
>
>This discussion is about the proposed ANSI behavior of malloc(0): namely
>returning (char*)0.
>
Its really about a rumor about the standard. The actual proposed
standard says (4.10.3)
"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."
In other words the status of malloc(0) is exactly the same as it is
now. In some implementations it will return a null pointer and in
others it won't. A program that assumes either behavior may be
conforming but not strictly conforming (i.e. not maximally portable).
Jerry Schwarz
AT&T Bell Labs, Murray Hill
Technical Details
Message-ID:
<11418@ulysses.homer.nj.att.com>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!ulysses!hector!jssReferences:
<9962@smoke.BRL.MIL> <3240@goofy.megatest.UUCP>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!ulysses!hector!jss From: jss@hector.UUCP (Jerry Schwarz) Newsgroups: comp.std.c Subject: Re: realloc Message-ID: <11418@ulysses.homer.nj.att.com> Date: 7 Apr 89 14:33:42 GMT References: <9962@smoke.BRL.MIL> <3240@goofy.megatest.UUCP> Sender: netnews@ulysses.homer.nj.att.com Reply-To: jss@hector.UUCP (Jerry Schwarz) Organization: AT&T Bell Laboratories Lines: 21