Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!think!snorkelwacker!apple!oracle!news From: gstein@oracle.com Newsgroups: comp.sys.mac.programmer Subject: Re: MPW compiler bugs Message-ID: <1990Feb16.012322.19895@oracle.com> Date: 16 Feb 90 01:23:22 GMT Sender: news@oracle.com Reply-To: gstein@oracle.com () Organization: Oracle Corporation, Belmont, CA Lines: 37 Steve Bollinger writes: >Greg Stein writes: >John, I will agree with you, though, about the Linker. Think C >>includes code a whole file at a time -- it won't pick out individual >>routines from a file. MPW C will do this. What I don't get is why >>Think C hasn't changed this by now -- they've had a few versions to do >>it. Heck, in high school when I wrote the Rascal compiler for the >>Mac, I wrote a linker that did dead code analysis and picked out a >>routine at a time. Surely, Mike Kahl could do it. > >Think C DOES indeed remove dead code, ever since version 3.0. It doesn't seem >to do quite as good a job as MPW 3.0, but a good job none the less. To >remove dead code, just check the 'Smart Link' check box when you build your >app/DA/whatever. You can go out and prove it to yourself by writing a >program which uses one small routine from the ANSI library, and building it to >disk. Whereas the ANSI library is 27K long, your program will come out to >about 5 or 6K. > Hmm... I had thought that Think C works on a file by file basis. If you include a routine from a file, the WHOLE file is pulled in. Note, though, that this doesn't count for projects/libraries: in these it picks the file out of the project. As for the ANSI library, Think has split up the source into a bunch of tiny files. Since you use one routine, you get one (little) file. I know that using "Run..." doesn't do any dead code analysis and you pick up whole libraries/ projects (e.g. MacTraps), but building is different. Maybe I'm brain dead and they've fixed this. Unfortunately, I have to wait until I get home to check cuz we don't use Think C here at work :-( Happy hacking... Greg Stein -- This posting bears no relation to my employer Arpa: gstein%oracle.uucp@apple.com UUCP: ..!{uunet,apple}!oracle!gstein