Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!caip!ut-sally!pyramid!amiga!jimm From: jimm@amiga.UUCP (James D. Mackraz) Newsgroups: net.micro.amiga Subject: Re: printf() code size using Astartup.obj and AMIGA.LIB only Message-ID: <1364@amiga.amiga.UUCP> Date: Fri, 27-Jun-86 11:46:17 EDT Article-I.D.: amiga.1364 Posted: Fri Jun 27 11:46:17 1986 Date-Received: Sat, 28-Jun-86 08:48:29 EDT References: <8606270438.AA07486@pavepaws> <742@ucbcad.BERKELEY.EDU> Reply-To: jimm@homer.UUCP (Jim Mackraz) Organization: Commodore-Amiga Inc., 983 University Ave #D, Los Gatos CA 95030 Lines: 37 In article <742@ucbcad.BERKELEY.EDU> chapman@pavepaws.UUCP (Brent Chapman) writes: >In article <8606270438.AA07486@pavepaws> dillon@PAVEPAWS.BERKELEY.EDU (Matt Dillon) writes: >> >>source executable >> >>main() {} 1880 >>main() {printf("hello\n");} 2376 >> > >What you've just done is pretty useless. You could just as well use puts() >for that. printf() is "print FORMATTED". Give us some REAL examples, that >actually do some formatting, to see whether or not the code size increases >(in other words, whether or not the compiler is smart enough not to include >the formatting routines it doesn't need). I'm guessing, but I'd expect >code size to increase (I don't have my Amiga yet, so I can't test it >myself). >Brent Let me be the first in a long line of people commenting on this one. (It's 8:30 am pdt, june 27). It is not the business of the compiler (any compiler?) to interpret the data present at an address passed at run-time to a subroutine, and thereby to determine that certain functions called by that subroutine (in this case, formatters) won't actually actually be needed, and so on to indicate somehow to the linker that those references can be left unresolved. I guess that what I am saying is that you should buy an amiga and program a whole lot and learn a whole lot. jimm Also, I am told that the printf in the kernel (kprintf and the stuff it uses) don't handle floating point. The intent of those routines is for debugging use. I think I am in favor of building printf right into your system, but that wasn't the intent of kprintf, as I understand it. But then again, poof: I may be wrong.