Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!ucbvax!UMCVMB.BITNET!C506634 From: C506634@UMCVMB.BITNET ("Eric Edwards") Newsgroups: comp.sys.amiga.tech Subject: Re: strins() Message-ID: <8906150029.AA22430@jade.berkeley.edu> Date: 14 Jun 89 23:32:06 GMT Sender: daemon@ucbvax.BERKELEY.EDU Lines: 49 Sorry about the duplicate in comp.sys.amiga. I hit "reply" and amiga-relay only sends to comp.sys.amiga. Now back to our regulary scheduled posting... - - The original note follows - - In Measage ID<256@maytag.waterloo.edu> giguere@aries5.uucp says: >If you're trying to write small programs with as little library >overhead as possible you should avoid any of the (f/s/v)printf routines >if at all possible. As anyone who's looked through the bowels of a C >compiler knows, the printf routines are some of the largest routines >around and non-trivial to code. That's why the standard program > > main() > { > printf( "hello, world\n" ); > } > >is actually more of a test for the C compiler than you'd normally think. Lattice uses a bultin function to get arround this problem in printf. I quote from the Lattice manual, _Lattice C Compiler_ version 4.0 " printf When this function is called, the compiler examines the formatting string: * When it is a constant string with no substitutions, the compiler changes the printf call to a _write call. * When it is a constant string AND only contains %s, %d and p% formats a call is made to _tinyprintf " Disclaimer: All typos are assumed to be mine, not the manual's. Further they say they may do similar tricks for scanf, sprintf and fprintf but upon checking my 5.0 manual I don't thing they have done this to date. >Eric Giguere 268 Phillip St #CL-46 >For the curious: it's French ("jee-gair") Waterloo, Ontario N2L 6G9 Bitnet: C506634@umcvmb.bitnet __________________________ Internet: C506634@umcvmb.missouri.edu / \.--------. / \ "The Amiga just isn't reliable enough unless you | | Eric |---------+ | know a lot about the machine" -- Jerry Pournelle | `--------' ! | ================================================|| .--------. ! | "I did notice that at my party people stood in | | Edwards|_________+ | line to play with the Amiga"-- Jerry Pournelle | /`--------' ^ | BYTE, October '88 \__________________________/ \\\ Note Forwarded on: 06/14/89 19:16:30 /// \\\ To: AMIGATEC ///