Xref: utzoo comp.software-eng:2611 comp.misc:7584 Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!wuarchive!mit-eddie!bu-cs!polygen!bill From: bill@polygen.uucp (Bill Poitras) Newsgroups: comp.software-eng,comp.misc Subject: Re: Coding standards (was Re: Programmer productivity) Keywords: One function per file? Message-ID: <600@fred.UUCP> Date: 5 Dec 89 15:17:34 GMT References: <34796@regenmeister.uucp> <2226@jato.Jpl.Nasa.Gov> <128179@sun.Eng.Sun.COM> <546@sagpd1.UUCP> <4727@netcom.UUCP> <4290@pegasus.ATT.COM> <9185@hoptoad.uucp> Reply-To: bill@fred.UUCP (Bill Poitras) Organization: Polygen Corporation, Waltham, MA Lines: 22 In article <9185@hoptoad.uucp> tim@hoptoad.UUCP (Tim Maroney) writes: %In article <4290@pegasus.ATT.COM> dmt@pegasus.ATT.COM (Dave Tutelman) writes: %%There IS one argument, in some cases a compelling one, for "one function %%per file". In general, linkers aren't smart enough to link just %%PART of a binary file (.OBJ or .o), when that file contains a function %%needed by the link. % %WHAT? What year is this? I don't think I've ever used a linker that %didn't eliminate unused routines. Any such linker would be seriously %brain damaged. %-- %Tim Maroney, Mac Software Consultant, sun!hoptoad!tim, tim@toad.com Yes you have. ANY linker you have does this. What you are thinking of is a LIBRARY, ie. .lib file. (lib*.a if you're a Unix person), which when used in the link process, only the functions used in the program begin linked, get linked. Although I'm not a compiler/linker expert, I almost positive that this is true. +-----------------+---------------------------+-----------------------------+ | Bill Poitras | Polygen Corporation | {princeton mit-eddie | | (bill) | Waltham, MA USA | bu sunne}!polygen!bill | +-----------------+---------------------------+-----------------------------+