Path: chuka.playstation.co.uk!scea!greg_labrec@interactive.sony.com From: sumner@metrowerks.com (Joel Sumner) Newsgroups: scea.yaroze.programming.codewarrior Subject: Re: Some concerns and ideas re CW Date: Fri, 11 Jul 1997 10:22:18 -0500 Organization: Metrowerks Lines: 35 Message-ID: References: <01bc8513$4e939960$9fbf43ce@wkwerner> <33b95c29.25784289@news.scea.sony.com> <01bc869b$d2a65420$6fbf43ce@wkwerner> <33c5903d.29746230@news.scea.sony.com> NNTP-Posting-Host: 198.214.227.194 X-Newsreader: Anawave Gravity v1.10 In article <33c5903d.29746230@news.scea.sony.com>, jamin1@psu.edu says... > On 2 Jul 1997 03:55:19 GMT, "Wayne K. Werner" > wrote: > >When you create an object file, the entire file is linked into your program > >if you access just a single data or function symbol in that object file. > >If you use just one function out of a hundred, the full hundred still show > >up in your executable. Since the whole idea of objects is to create > >reusable code, often objects have much more functionality than is used in a > >particular application. But you usually get the whole bag anyway. One > >solution is to create static link librarys when you create general use > >objects, and break up the source code into modules containing individual > >member functions. The library makes a convenient way to keep the whole > >object together in one place while the fracturing of the code will prevent > >you from linking in more than you asked for. > > Yea, I guess this highly depends on the generality of your > object libraries, too. I haven't got far enough to worry about making > my libraries over-generalized, though. :^) Just a note, the CodeWarrior linker is "smarter than the average bear". It will dead strip any unused functions. Thus, you don't have to worry about linking in functions that you don't use. You can see evidence of this when you run a program through the debugger. Any functions that are never called with have no tick-marks next to the instructions in that function because the code doesn't exist in the executable. This applies to both user source and included libraries. -Joel -- ------------------------- PlayStation Debugger Dude Metrowerks