gccseems to be telling me int foo(int (*f)(void)) is the same as int foo(int (f)(void))
f is a pointer to a function taking no argument returning int. Why can we omit the * here.
However, I also tried int (*p)(void) and int (p)(void). The first p is a function pointer, while the second is a function.
So, what’s happening? Under what circumstances can the asterisk be omitted?
I look it up in K&R and discovered nothing.
To quote from my copy of Harbison and Steele (5th edition, section 9.3):
That means that in the context of a formal parameter list, they are equivalent. In any other context, they are different.
As a matter of style, I would never omit the *.