Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!elroy.jpl.nasa.gov!usc!snorkelwacker.mit.edu!hsdndev!cmcl2!kramden.acf.nyu.edu!brnstnd From: brnstnd@kramden.acf.nyu.edu (Dan Bernstein) Newsgroups: comp.lang.c Subject: Re: realloc((char *)NULL,size) - how standard ? Message-ID: <15112:Feb2419:11:4391@kramden.acf.nyu.edu> Date: 24 Feb 91 19:11:43 GMT References: <1991Feb16.010828.2152@pscnet.UUCP> <1991Feb24.071716.409@athena.mit.edu> Organization: IR Lines: 12 In article <1991Feb24.071716.409@athena.mit.edu> scs@adam.mit.edu writes: > Passing an initially-null pointer to realloc can make it very easy > to write a self-starting incremental allocation algorithm. I find this advice counterproductive. Much better would be Passing an initially null pointer to realloc may seem a tempting way to write a self-starting incremental allocation algorithm, but it is simply not portable. It's just as easy---and much more portable---to start by allocating one element. ---Dan