Re: when can realloc fail?



On Apr 2, 8:17 am, "santosh" <santosh....@xxxxxxxxx> wrote:
But realloc with a new size of zero either returns a
null pointer, upon failure, or returns an indeterminate value.

I don't see any text in the standard to support this.

In fact, it seems absurd, as undefined behaviour would
be caused as soon as the user checked or stored the
return value.

The text in 7.20.3.4 in C99 only says that the items pointed
to by the return value are indeterminate.

.



Relevant Pages

  • =?WINDOWS-1252?Q?2.6.23-rc3-mm1_--_drivers/net/wireless/rt2x00mac.c:65:_e?= =?WI
    ... 'ieee80211_ctstoself_get' makes pointer from integer without a cast ... # CPU idle PM support ... # Infrared-port device drivers ...
    (Linux-Kernel)
  • Re: Unhandled exception
    ... function just correct some pointer accidently. ... we need at least a sample to repro it. ... problem is quite related to CWebRequest class, is it possible for you to ... In newsgroup support, currently we don't provide ...
    (microsoft.public.vc.mfc)
  • Re: What will be the next MAJOR programming language for commercial use?
    ... > Does D support pointer arithmetic? ... D has Contract Programming which can help a great deal. ... That's exactly what a dynamic closure is. ... > having syntactic sugar to support them. ...
    (comp.lang.misc)
  • Re: gcc-4 ?
    ... > required to support ... > warning: structure `c_switch' used but not defined ... > assignment discards qualifiers from pointer target type ...
    (freebsd-questions)
  • Re: Zero length array declaration
    ... > you should use a pointer to a buffer containing a message. ... >> compilers may let you get away with it. ... include support for and/or the struct hack which had the benefit ...
    (comp.lang.c)