Xref: utzoo comp.sys.m6809:753 comp.lang.c:8867 Path: utzoo!mnetor!uunet!husc6!mailrus!ames!eos!labrea!decwrl!decvax!watmath!atbowler From: atbowler@watmath.waterloo.edu (Alan T. Bowler [SDG]) Newsgroups: comp.sys.m6809,comp.lang.c Subject: Re: Don't use Scanf() Message-ID: <17987@watmath.waterloo.edu> Date: 3 Apr 88 22:32:06 GMT References: <2401@ihwpt.ATT.COM> <320@c10sd1.StPaul.NCR.COM> <9241@sunybcs.UUCP> <517@picuxa.UUCP> Reply-To: atbowler@watmath.waterloo.edu (Alan T. Bowler [SDG]) Organization: U. of Waterloo, Ontario Lines: 16 Keywords: C stdio library In article <517@picuxa.UUCP> gp@picuxa.UUCP (Greg Pasquariello X1190) writes: > These are library calls, and although the compiler will generate >approximately the same function calling sequence, the linker will link in >a much larger function in printf(). > Actually this may or may not be true. If the library implementor has carefully built his PRINTF code so that it is can be used reentrantly (i.e no statics) then it is quite likely that code in the guts of the library already references PRINTF in order to give good error messages. I.e. it may be near impossible to build a C program that does not include PRINTF. As always, there may be good reasons for not using PRINTF in a particular situtation, but blanket generalizations like "the linker will link in a much larger function in printf()" just are not true across all implementations. Make it correct first, optimize second.