S.Tobias said:
The latter. The name of a function evaluates to a pointer to that function.
Much like the name of an array evaluates to a pointer to (the first element
of) that array.
I think both are correct, see 6.3.2.1#4 and 6.5.3.2#1.
+++++
int a[10];
int *pi;
pi = a; //(1) okay
pi = &a; //(2) *wrong!*, diagnostics
I think it was allowed to use (2) in the distant past (I vaguely remember
even seeing code with such construct). What's the story behind this?
Note that you're talking about two different things here, the behavior
of unary "&" when applied to a function, and the behavior of unary "&"
when applied to an array. Presumably the "+++++" marks a change of
topic.
Any occurrence of a function name, except as the operand of a unary
"&" or sizeof operator, is converted to a pointer to the named
function. (The sizeof exception makes "sizeof func" illegal rather
than making it yield the size of a function pointer.) So "func" and
"&func" are equivalent (as expressions, not necessarily as token
sequences). This applies even to function calls; in a call like
foo(42), you're applying the "()" function call operator to the
address of foo.
As for arrays, "a" is converted to a pointer to the first element of a
(a pointer to int), whereas "&a" gives you the address of the array (a
pointer to an array of 10 ints). These are going to be the same
address, and will probably have the same representation. Older
(pre-ANSI) compilers with weaker type checking might treat them as
interchangeable.