Path: utzoo!attcan!uunet!twwells!bill From: bill@twwells.com (T. William Wells) Newsgroups: comp.lang.c Subject: Re: effect of free() Message-ID: <1989Sep23.092216.14283@twwells.com> Date: 23 Sep 89 09:22:16 GMT References: <319@cubmol.BIO.COLUMBIA.EDU> <3756@buengc.BU.EDU> <1989Aug17.005548.745@twwells.com> <16022@vail.ICO.ISC.COM> <248@seti.inria.fr> <246@ssp1.idca.tds.philips.nl> <21952@cup.portal.com> <10983@smoke.BRL.MIL> <591@augean.OZ> <125@bbxsda.UUCP> <154@bbxsda.UU Organization: None, Ft. Lauderdale, FL Lines: 35 In article <154@bbxsda.UUCP> scott@bbxsda.UUCP (Scott Amspoker) writes: : >: It's not very hard to factor in the notion that a pointer is "poison" : >: when it no longer points to valid storage. One would think that : >: "well-written code" would already follow that model, which is : >: compatible with a wider range of environments. I do sort of object to the sequence you imply here: first, you did not properly attribute it. Second, you made it appear that I said that my code never dealt properly with freed pointers. I doubt that your intent was malicious, but I'd appreciate more care in the future. : >Mine always did. Even before I learned to think about portability. It : ^^^^^^^^^^^^^^^ : >just never occured to me that a freed pointer was anything but : >nonsense. : : How do you know? Although a bad example using the free() call was : what started all of this the discussion has turned to the more general : problems of handling pointers. I don't doubt that your calls to : free() are clean. What about every other place that pointers are : used? How many other programmers are working on your project with : you? If you did handle a bad pointer at one point (even though : program logic would not deference that pointer under those conditions) : how would you know (without personally examining every line of code)? : Chances are your machine is allowing it so there would be no trap : generated. You missed the point. I did *not* say that my programs never referenced a pointer after it was freed. Don't I wish. What I'm saying is that I never *designed* a program to do that. And it never would have occured to me to even try. A freed pointer is *gone*. --- Bill { uunet | novavax | ankh | sunvice } !twwells!bill bill@twwells.com