Path: utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!pacbell.com!ucsd!ucbvax!MITCH.ENG.SUN.COM!wmb From: wmb@MITCH.ENG.SUN.COM (Mitch Bradley) Newsgroups: comp.lang.forth Subject: Re: Size of C Message-ID: <9101100302.AA08161@ucbvax.Berkeley.EDU> Date: 8 Jan 91 22:49:57 GMT Sender: daemon@ucbvax.BERKELEY.EDU Reply-To: Mitch Bradley Organization: The Internet Lines: 20 > > Printf() is notorious for including a lot of formatting code. ... Most C implementations only include the library routines that are actually used. The problem with printf() is that it is supposed to be able to handle a variety of different number types, including floating point numbers. The determination of which format to use at any given time is made by a string argument that can be constructed at run time. Therefore, the linker usually does not know whether or not the floating point libraries are going be be needed or not, and the implementor often chooses to err in the safe direction. In the C "wrapper" programs that I use for interfacing Forth to various operating systems, I avoid printf(), instead using puts(). If I need to display numbers, I write my own "puti()" routine. The trend in operating systems is going toward shared libraries, so the size of printf() is beginning to cease to matter, as a single copy of the library is shared among all the processes in the system. Mitch