Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!lll-winken!uunet!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!pacbell.com!ucsd!ucbvax!bloom-beacon!bloom-picayune.mit.edu!athena.mit.edu!jik From: jik@athena.mit.edu (Jonathan I. Kamens) Newsgroups: comp.lang.c Subject: Re: realloc() (was: Re: Safe coding practices) Message-ID: <1991Jan30.204159.5726@athena.mit.edu> Date: 30 Jan 91 20:41:59 GMT References: <1991Jan30.193308.3897@athena.mit.edu> <23975:Jan2516:36:5891@kramden.acf.nyu.edu> <1991Jan30.121425.16882@unhd.unh.edu> <1991Jan30.201955.21797@ux1.cso.uiuc.edu> Sender: news@athena.mit.edu (News system) Organization: Massachusetts Institute of Technology Lines: 16 In article <1991Jan30.201955.21797@ux1.cso.uiuc.edu>, mcdonald@aries.scs.uiuc.edu (Doug McDonald) writes: |> So the quote preceeded by > signs is not true for a correct realloc. |> You CAN reuse p and *p after a failed realloc. We're not talking about "a correct realloc." Remember that the book in question is //Portability and the C Language//. If you want to assume that because ANSI C specifies realloc() as you quoted, all implementation of realloc() you come across specify it in that way, that's your right, but I doubt such an assumption is portable, which is why Jaeschke gave the restriction he did. -- Jonathan Kamens USnail: MIT Project Athena 11 Ashford Terrace jik@Athena.MIT.EDU Allston, MA 02134 Office: 617-253-8085 Home: 617-782-0710