Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!pilchuck!dataio!fnx!nazgul!bright From: bright@nazgul.UUCP (Walter Bright) Newsgroups: comp.lang.c Subject: Re: EXE file size, C vs. Pascal Keywords: C, Pascal, MsDos Message-ID: <158@nazgul.UUCP> Date: 12 Nov 90 20:14:13 GMT References: <16398@mentor.cc.purdue.edu> Reply-To: bright@nazgul.UUCP (Walter Bright) Organization: Zortech, Seattle Lines: 15 In article <16398@mentor.cc.purdue.edu> nuspljj@mentor.cc.purdue.edu (Joseph J. Nuspl Jr.) writes: /I am trying to keep the size of the /executables small and have the speed of execution as fast as possible. /BTW - I don't have time to code every thing in Assembler. It is possible to write very tiny executables in C. The trick is to avoid pulling in unused overhead from the C standard library. The first thing to do is generate a .MAP file and look at it to see what you are pulling in. Then, see if large and complex functions can be replaced by small and simple once. For instance, make sure you are not pulling in floating point code if you aren't using it. Also, try to replace things like printf("abc") with puts("abc"), as printf is very big and pulls in a lot. Purchase the library source for your compiler, and study it to see what depends on what. I think you'll find it very worthwhile!