Xref: utzoo comp.std.c:935 comp.lang.c:17251 Newsgroups: comp.std.c,comp.lang.c Path: utzoo!henry From: henry@utzoo.uucp (Henry Spencer) Subject: Re: realloc Message-ID: <1989Mar29.205433.3958@utzoo.uucp> Organization: U of Toronto Zoology References: <10170@bloom-beacon.MIT.EDU> Date: Wed, 29 Mar 89 20:54:33 GMT In article <10170@bloom-beacon.MIT.EDU> scs@adam.pika.mit.edu (Steve Summit) writes: >... It is an apparently well- >kept secret that realloc is supposed to behave gracefully at >a slightly special-cased boundary point: when handed a NULL >pointer and a nonzero size, it acts essentially as a malloc. Unfortunately, this is (at present) not a portable assumption, because neither V6 nor V7 Unix -- the Unixes from which essentially all others are descended, and which included the first widely-known C compilers -- did this. It was invented later. There are probably a fair number of old systems that haven't caught up with it. (It *is* in ANSI C as of the Oct. draft, so it will *eventually* be a portable assumption.) -- Welcome to Mars! Your | Henry Spencer at U of Toronto Zoology passport and visa, comrade? | uunet!attcan!utzoo!henry henry@zoo.toronto.edu