Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!shadooby!samsung!uunet!inmet!porges From: porges@inmet.inmet.com Newsgroups: comp.misc Subject: Re: Coding standards (was Re: Progr Message-ID: <24000001@inmet> Date: 6 Dec 89 17:15:00 GMT References: <9185@hoptoad.uucp> Lines: 39 Nf-ID: #R:hoptoad.uucp:9185:inmet:24000001:000:1044 Nf-From: inmet.inmet.com!porges Dec 6 12:15:00 1989 >/* Written 9:33 pm Dec 4, 1989 by tim@hoptoad.uucp in inmet:comp.misc */ >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 Then you've never used Sun3 ld, or any other Unix linker. Remember, he's talking about parts of a .o file, not members of a library. For example: a.c: main() { b() } b.c: b() { } c() { } The resulting link of a.o and b.o will include the routine 'c'. This can be verified by nm, or by inspecting the a.out file with adb. -- Don Porges porges@inmet.inmet.com ..uunet!inmet!porges