In the absence of any preprocessor stuff going on, foo
's signature is equivalent to
int foo (int *bar)
The only context in which I've seen people putting seemingly unnecessary parentheses around function names is when there are both a function and a function-like macro with the same name, and the programmer wants to prevent macro expansion.
This practice may seem a little odd at first, but the C library sets a precedent by providing some macros and functions with identical names.
One such function/macro pair is isdigit()
. The library might define it as follows:
/* the macro */
#define isdigit(c) ...
/* the function */
int (isdigit)(int c) /* avoid the macro through the use of parentheses */
{
return isdigit(c); /* use the macro */
}
Your function looks almost identical to the above, so I suspect this is what's going on in your code too.
a(b);
? Declaration ofb
as a variable of typea
? Or a call to functiona
with argumentb
? The difference is syntactic, and you cannot know which way to even parse it without looking up the declaration info ofa
; i.e. are those postfix function call parentheses, or optional parentheses around a declarator.