What is useful about this C
syntax — using \'K&R\' style function declarations?
int func (p, p2)
void* p;
int p2;
{
return 0;
}
That's a relic from when C had no prototypes for functions. Way back then, (I think) functions were assumed to return int
and all its arguments were assumed to be int
. There was no checking done on function parameters.
You're much better off using function prototypes in the current C language.
And you must use them in C99 (C89 still accepts the old syntax).
And C99 requires functions to be declared (possibly without a prototype). If you're writing a new function from scratch, you need to provide a declaration ... make it a prototype too: you lose nothing and gain extra checking from the compiler.