Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!samsung!zaphod.mps.ohio-state.edu!rpi!uupsi!sunic!news.funet.fi!funic!nic!vinsci From: vinsci@nic.funet.fi (Leonard Norrgard) Newsgroups: comp.sys.amiga.programmer Subject: Re: How are some programs SO DAMN SMALL! Message-ID: Date: 21 Jan 91 01:39:35 GMT References: <1991Jan20.210328.18087@hoss.unl.edu> Sender: vinsci@nic.funet.fi (Leonard Norrgard) Organization: Soft Service, Inc. Lines: 23 In-Reply-To: 231b3678@fergvax.unl.edu's message of 20 Jan 91 21:03:28 GMT In article <1991Jan20.210328.18087@hoss.unl.edu> 231b3678@fergvax.unl.edu (CS 231 section 2) writes: #include main(){printf("hey man!\n");} the result is 4424 bytes, OPTIMIZED and all. How can a HUGE clock compile smaller then a printf statement. If it was a printf *statement* maybe then it would be smaller. Now however, it is a call to a library routine that depends on C stdio, which is usually large. Basically your single call to printf drags in lots and lots of code to handle all kinds of things. Try this: main(){Write(Output(),"Hey man!\n",9);} The result should be much smaller. However, since you do not use stdio in the program (Write() is not stdio) you can use the lattice _tinymain instead. See the library manual, page L264 for usage. Phil Dietz -- Leonard