Path: utzoo!attcan!uunet!lll-winken!ames!xanth!nic.MR.NET!umn-d-ub!uwvax!dogie!yahnke@vms.macc.wisc.edu From: yahnke@vms.macc.wisc.edu (Ross Yahnke, MACC) Newsgroups: comp.sys.mac.programmer Subject: Re: serious code generation bug in Lightspeed C Message-ID: <1112@dogie.edu> Date: 18 Jan 89 14:10:40 GMT Sender: news@dogie.edu Organization: University of Wisconsin Academic Computing Center Lines: 52 In article <6327@hoptoad.uucp>, tim@hoptoad.uucp (Tim Maroney) writes... >In article <1532@cps3xx.UUCP> rang@cpswh.cps.msu.edu (Anton Rang) writes: >> Well, maybe not *well* documented, but documented at least. From >>Inside Mac, volume II, page 16: >> >> The Lisa Pascal compiler frequently dereferences handles during >> its normal operation..... > >Yes, but that starts with "The Lisa Pascal compiler". There is nothing >documented about this being a problem with C... >Nor does THINK document it with reference to LSC... >-- >Tim Maroney, Consultant, Eclectic Software, sun!hoptoad!tim Tim, you are simply wrong, and obstinate to belabour the issue. As other people in this group have pointed out, the problem you've mentioned is documented in Inside Mac. Yes, of course the examples are in Pascal. That was the only development language readily available when the Mac was brought out. I don't think it takes a PhD. to extrapolate the hows and whys of the problem from Pascal to C, the two languages are not that incredibly different. For you to say that "There is nothing documented about this being a problem with C" is a specious palaver, and also completely untrue. In the latest set of documentation for LSC, the small set of double manuals with the Symantec label that was issued for the 2.0 release, on Page 121 of the User's Manual: If you are dereferencing Handles, make sure that the memory the Handle points won't move while using it. Otherwise, HLock it (and HUnlock it later). Example: HLock(aTEH); /* Without the previous HLock, */ /* the next two calls may not always work */ /* (1) printf calls Memory Mgr: */ printf("first char in text handle is %c\n", **(**aTEH).hText); /* (2) Handle dereference on the left is done BEFORE call: */ (**aTEH).hText = (Handle)NewHandle(somesize); HUnlock(aTEH); So the problem *IS* well documented if only you bother to read the manual. You do *own* a copy of the manual, don't you? //////////////////////////////////////////////////////////// Internet: yahnke@vms.macc.wisc.edu Bitnet: yahnke@wiscmacc(.bitnet) \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\