Possible Duplicate:
C function syntax, parameter types declared after parameter list
I was browsing through some C code and found the definition of the inet_pton function (on a .c file):
int
inet_pton(af, src, dst)
int af;
const char *src;
void *dst;
...
The funny thing here is that the parameters for the function have their types specified in a way I have never seen before. On the corresponding header file, the parameter types are specified as usual:
extern int inet_pton (int __af, __const char *__restrict __cp,
void *__restrict __buf) __THROW;
My question is then: is this some sort of C trick? Can you always define the parameter types for a function inside of its scope?
It looks like old, Kernighan & Ritchie C style.
Although it can be found in legacy code, this coding style is not considered good practice anymore and I guess it’s not compatible with ANSI C or more modern C99 or C11, so don’t use it.