Compressing C programs

Scott Amspoker scott at bbxsda.UUCP
Tue Jan 9 08:56:05 AEST 1990


In article <7600 at hubcap.clemson.edu> grimlok at hubcap.clemson.edu (Mike Percy) writes:
>If you can avoid using printf, do so. Printf drags in a large routine.
>Many times you can use puts rather than printf.  In my experience, puts
>is not only smaller than printf, but faster.
> 
>Another thing in TurboC to avoid if possible is dragging in the floating
>point libraries when you don't need them.

This is probably the main reason a small program would create a large
.EXE file.  Using printf() will cause the floatingpoint library to be
linked in unless you tell Turbo C not to bother (I can't remember the
switch off hand).  Without the floatingpoint library, printf()
is not very large.  Also, I agree that using puts() whenever possible
is a good idea even if you are also using printf() just for speed.

-- 
Scott Amspoker
Basis International, Albuquerque, NM
(505) 345-5232
unmvax.cs.unm.edu!bbx!bbxsda!scott



More information about the Comp.lang.c mailing list