Path: utzoo!attcan!uunet!husc6!uwvax!rutgers!mailrus!uwmcsd1!bbn!bbn.com!levin From: levin@bbn.com (Joel B Levin) Newsgroups: comp.sys.mac.programmer Subject: Re: LSC 3.0, argc & argv, linking Message-ID: <29449@bbn.COM> Date: 8 Sep 88 14:21:23 GMT References: <66791@sun.uucp> <2391@pixar.UUCP> <59@calmasd.GE.COM> Sender: news@bbn.COM Reply-To: levin@BBN.COM (Joel B Levin) Organization: BBN Communications Corporation Lines: 32 In article <59@calmasd.GE.COM> jnp@calmasd.GE.COM (John Pantone) writes: | |Are you saying that ThinkC and Unix will not allow something like: | |link my_main with (my_)printf and anything else needed from lib c |(except the copy of printf in there) | |where the printf explicitly specified also exists in lib c, but I wish |it to be superceeded by my version? | |Then the ThinkC and the Unix linker are outmoded and weak, to say the |least. REAL linkers have allowed this sort of selective replacement |for years. . . . The UNIX(TM) linkers I have known, and the MPW linker as well, do allow exactly this. But there is one problem that you have to watch out for. Using your example: if the module within the library which contains printf also contains (say) sprintf, AND my_main calls sprintf as well as printf, AND you do not provide a substitute (my_)sprintf, then when the linker attempts to resolve the sprintf reference, it will find itself with two entries for printf. This will make it unhappy. The solution is to determine all the entry points in the standard library module containing printf and to provide those entry points in your own version. As to the previous question: sorry, I have no idea what ThinkC does. /JBL UUCP: {backbone}!bbn!levin POTS: (617) 873-3463 INTERNET: levin@bbn.com