August Karlstrom said:
What's the cause of the inconsistency between variable and parameter
declarations in C? What's wrong with e.g.
void f(int a, b; char c);
In an old-style declaration, that would look like:
f(a, b, c);
or, in the function definition:
f(a, b, c);
int a, b;
char c;
{
...
}
With prototypes, the parameter declarations are still separated by
commas, rather than the semicolons that are used to terminate ordinary
declarations. If the inventors of prototypes had chosen to use
semicolons rather than commas:
void f(int a; int b; char c); /* optional semicolon after c? */
then it would make sense to allow commas as well:
void f(int a, b; char c);
But it wasn't done that way, and I doubt that it could be changed
without breaking existing code, or at least causing confusion in some
cases.
Using semicolons rather than commas in prototypes might have been more
consistent, but I don't think it's worth fixing. I almost always
prefer to have one item per declaration anyway.