Path: utzoo!attcan!uunet!mcvax!ukc!dcl-cs!nott-cs!anw From: anw@nott-cs.UUCP Newsgroups: comp.lang.c Subject: Re: Efficient coding considered harmful? Message-ID: <592@tuck.nott-cs.UUCP> Date: 22 Nov 88 18:24:38 GMT References: <3105@hubcap.UUCP> <34112@XAIT.XEROX.COM> <1700@dataio.Data-IO.COM> <7700@bloom-beacon.MIT.EDU> <771@wsccs.UUCP> <437@auspex.UU Reply-To: anw@maths.nott.ac.uk (Dr A. N. Walker) Organization: Department of Mathematics, The University, NOTTINGHAM, NG7 2RD, UK. Lines: 41 In article <437@auspex.UUCP> guy@auspex.UUCP (Guy Harris) writes: > >In fact, if prototypes had been there since Day 1 and had been the >*only* way of declaring functions (this may perhaps have made the >language too big for the PDP-11 to compile, I don't know - I'm not ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Naw! Let's see [PDP 11/44, V7]: $ ls -l /lib/c? -rwxrwxr-x 1 bin system 23924 May 7 1979 /lib/c0 -rwxrwxr-x 1 bin system 35282 May 16 1979 /lib/c1 -rwxrwxr-x 1 bin system 11632 Jul 11 1980 /lib/c2 $ size /lib/c? /lib/c0: 20736+3172+11552 = 35460b = 0105204b /lib/c1: 30592+4674+1206 = 36472b = 0107170b /lib/c2: 10176+1440+2430 = 14046b = 033336b Plenty of room there for expansion, even with a 64K limit! >saying that this would necessarily have been the best thing), and if >"varargs" or "stdarg" had been the only permissible way of doing >variable-length-argument-list functions, calling sequences where the >callee, rather than the caller, could safely have been used (since the >compiler could feel reasonably confident that if a function expects N >arguments of particular types, it will be passed just such a list of >arguments), and it has at least been asserted that on some machines, >such calling sequences are faster (e.g., the debates over the "C" and >"Pascal" calling sequences on 80*86 machines). Of course, the real solution to the "varargs" problem, not possible in C because of the dead hand of history, is to use extra brackets, so that every function has a fixed number of arguments: printf ("%d %c %s\n", (i, c, "hello world")); ^...arg1...^, ^.......arg2........^ Now, what language did I see that nifty idea in? [:-)] -- Andy Walker, Maths Dept., Nott'm Univ., UK. anw@maths.nott.ac.uk