ANSI C prototypes

Boyd Roberts boyd at necisa.ho.necisa.oz
Wed Oct 31 11:49:17 AEST 1990


In article <1005 at christopher-robin.cs.bham.ac.uk> ptf at uk.ac.bham.cs (Paul Flinders <FlindersPT>) 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 at necisa.ho.necisa.oz.au

``When the going gets wierd, the weird turn pro...''



More information about the Comp.lang.c mailing list