Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!lll-winken!elroy.jpl.nasa.gov!swrinde!ucsd!network.ucsd.edu!slamont From: slamont@network.ucsd.edu (Steve Lamont) Newsgroups: comp.sys.sgi Subject: Re: realloc reactions ?? Message-ID: <4786@network.ucsd.edu> Date: 15 Feb 91 19:09:56 GMT References: <9102150952.AA24219@karron.med.nyu.edu> Organization: Naval Postgraduate School, Monterey, CA Lines: 43 In article <9102150952.AA24219@karron.med.nyu.edu> karron@cmcl2.nyu.edu writes: > >I am curious about the realloc function. Me too, but for a different reason than Dan. Why does SGI's realloc() barf on a null pointer. F'rinstance #include #if defined( mips ) #include #else if defined( __STDC__ ) #include #else char *realloc(); #endif main() { char *foo = ( char *) NULL; foo = ( char *) realloc( foo, 100 ); printf( "I allocated foo at %08lx\n", foo ); exit( 0 ); } provides me with Bus error (core dumped) in small, unfriendly letters on an SGI. On all other platforms it gives me a valid pointer. Bug, feature, misfeature, or hallucination? spl (the p stands for plethora of pointers) -- Steve Lamont, SciViGuy -- (408) 646-2572 -- a guest at network.ucsd.edu -- NPS Confuser Center / Code 51 / Naval Postgraduate School / Monterey, CA 93943 "Unix is not a "A-ha" experience, it is more of a "holy-shit" experience." - Colin McFadyen in alt.folklore.computers