address of function
Doug Gwyn
gwyn at smoke.BRL.MIL
Thu Jun 8 07:47:03 AEST 1989
In article <2700 at solo8.cs.vu.nl> maart at cs.vu.nl (Maarten Litmaath) writes:
>Why weren't function pointers handled the way below?
> int foo(), (*bar)() = &foo;
>ANSI has fixed this, right?
It's not feasible to fix something in widespread correct usage.
A function designator gets turned into a pointer to the function
in all contexts except as the operand of sizeof or &. The latter
makes your example correct, although apparently some existing
compilers disallowed use of & in that context.
More information about the Comp.lang.c
mailing list