Xref: utzoo comp.lang.c:33293 alt.religion.computers:1983 Path: utzoo!utgpu!cs.utexas.edu!samsung!munnari.oz.au!metro!cluster!necisa!boyd From: boyd@necisa.ho.necisa.oz (Boyd Roberts) Newsgroups: comp.lang.c,alt.religion.computers Subject: Re: ANSI C prototypes Message-ID: <1906@necisa.ho.necisa.oz> Date: 31 Oct 90 00:49:17 GMT References: <1005@christopher-robin.cs.bham.ac.uk> Organization: NEC Information Systems Australia Pty. Ltd. Lines: 41 In article <1005@christopher-robin.cs.bham.ac.uk> ptf@uk.ac.bham.cs (Paul Flinders ) writes: > >in foo.h: > extern void ddprintf(const char *fmt, ...); > >BUT in foo.c: > > void ddprintf(va_alist) > va_dcl; > >this causes problems. Right on! The function prototypes are just stupid. I shouldn't have to go: extern gore *good(const char *vomit); to get the functionality of type checking of function arguments. The compiler and loader should do it. The computer is there to do the tedious stuff for you. The computer is (was) your friend. There should be enough stuff in the `.o' to specify all the calls to my function good() complete with the types of all the arguments. The `.o' that contains good() should contain extra information of the types of the arguments to good(). Then the loader should cross check all the calls with the declaration and then _refuse_ to load unless everything check out just right. Yes, that's right -- _refuse_. Now this would remove function prototyping once and for all. But, before you say `what about var args'. Things that are var arged should be specified as such on the command line. You say how many arguments to check. Now, I've seen it done and it's good. My old mate brucee did it `back in the hippy days' and it runs at the Labs. Ever heard of `cyntax'? Check out cyntax(1) in the Ninth Edition manual. Boyd Roberts boyd@necisa.ho.necisa.oz.au ``When the going gets wierd, the weird turn pro...''