Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!psuvax1!psuvm!cxt105 Organization: Penn State University Reply-To: cxt105@psuvm.psu.edu Summary: If you cannot stand the spoon upright, the coffee is too weak. Date: Monday, 12 Mar 1990 20:56:17 EST From: Christopher Tate Message-ID: <90071.205617CXT105@psuvm.psu.edu> Newsgroups: comp.sys.mac.programmer Subject: Re: ANSI library in THINK C 4.0 Distribution: world References: <90068.135735CXT105@psuvm.psu.edu> Just to let you all know, here's how I eventually built myself a fully- functional (including floating point formats) sprintf() routine, without having to include the entire ANSI library into my project: I traced out all of the calling dependencies for the sprintf() function, as defined in the ANSI source files (included with C). Then, I created my own working copies of the necessary files (stdio.c, printf.c, mem.c, bufio.c, str.c, fwrite.c) and added them to a project (called sprintf.pi). THEN, I eliminated from these working source files *all* routines that could not be invoked by a call to sprintf(), and compiled the project. This gave me a 3800-byte sprintf project that I could include in any application that needed it, without having to include any form of ANSI library to get it. The full ANSI library is just under 28,000 bytes, much of which does not get stripped away by the linker. When I used the ANSI library, my application linked (with Smart Link) to 37K. When I replaced ANSI with my sprintf project, it compiled to 21K. (!) Note: Rich Siegel suggested that I simply rebuild the "ANSI-small" library after commenting-out the "#define _NOFLOATING_" statement in the ansi_config.h header file. Thanks, Rich; that's a great idea if I ever need to use more of the library, but don't want all of the extras that come along with the full ANSI set. For this application, though, *all* I needed was a floating-point-capable sprintf() function. ------- Christopher Tate | "And as I watch the drops of rain | Weave their weary paths and die, cxt105@psuvm.psu.edu | I know that I am like the rain; {...}!psuvax1!psuvm.bitnet!cxt105 | There but for the grace of you go I." cxt105@psuvm.bitnet | -- Simon & Garfunkle