Declaring argument types

John Gilmore gnu at sun.UUCP
Tue Sep 13 17:31:10 AEST 1983


Now if only one could use the same syntax to declare a function
as to define it...eg, if you can say

int foo(int, struct bar *);

then can you say

int foo(int x, struct bar *p) {
	return x + p->foo;
}

Also, I assume that if you define the function in the same source file,
the compiler will default to checking and coercing the types of the
arguments in subsequent calls.  What do you do if you don't want that?
Perhaps declare it the old way first?  eg:

int foo();
int foo(x, y, p)
	int x, y;
	char *p;
{
	mess around with variable numbers of args
}

I know it's silly to comment on a proposal before it's been made, but
that's often the only time the designers are willing to consider changes...



More information about the Comp.lang.c mailing list