Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!princeton!caip!think!nike!ucbcad!ucbvax!PAVEPAWS.BERKELEY.EDU!dillon From: dillon@PAVEPAWS.BERKELEY.EDU (Matt Dillon) Newsgroups: net.micro.amiga Subject: printf does not take 10K Message-ID: <8606242147.AA12273@pavepaws> Date: Tue, 24-Jun-86 17:47:19 EDT Article-I.D.: pavepaws.8606242147.AA12273 Posted: Tue Jun 24 17:47:19 1986 Date-Received: Thu, 26-Jun-86 04:05:52 EDT Sender: daemon@ucbvax.BERKELEY.EDU Organization: University of California at Berkeley Lines: 35 It's more around 1K. The reason your lattice code is huge is that the startup _main() uses quite a bit of stdio, and other stuff. This coupled with the fact that Lattice does not know how to write libraries causes the 10-15K min. code size you usually get. x.c: main() { } y.c: main() { printf("x"); } normal linker (using lattice normal startup) x y code size 13896 14456 difference = 560 bytes. Now this makes you wonder what the hell lattice has got in their startup that would create a 13896 byte executable for a null program. ---------------- Note on amiga.lib's printf(). This is what you get when you don't use lattice's stuff. I'm very glad the people who put together AMIGA.LIB decided to put some standard calls in it. (THANK YOU!) What it means is that we get printf() without going through lattice. In the amiga.lib implimentation, remember that "%d" means a 'short' and "%ld" means a 'long'. Thus, with the Lattice compiler, you must ALWAYS specify "%ld" or "%8lx" or whatever. Q to amiga people: just how complete is amiga.lib's printf()? .. it has everything I've needed so far, but it would be nice to know it's limitations without having to run into them. -Matt