Path: utzoo!attcan!uunet!tut.cis.ohio-state.edu!cs.utexas.edu!asuvax!ncar!boulder!pikes!aspen.craycos.com!pmk From: pmk@craycos.com (Peter Klausler) Newsgroups: comp.lang.c Subject: Re: indirect reference/use of procedures Message-ID: <1990Mar19.163550.8685@craycos.com> Date: 19 Mar 90 16:35:50 GMT Organization: Cray Computer Corporation Lines: 24 Larry Jones notes: > Since "everyone knows" that you really use the address of a > function to call it (not the function itself), and since function > names usually turn into function pointers, it was far simpler to > specify that function "objects" "always" turn into function > pointers and that the function call operator requires a function > pointer. It does make the call more readable, but it breaks the > declaration/use symmetry as you noted. Section 3.2.2.1 says "Except when it is the operand of the sizeof operator or the unary & operator, a function designator... is converted to an expression that has type "pointer to function..."", and 3.3.3.2 notes "The unary * operator denotes indirection. If the operand points to a function, the result is a function designator." Thus, given a pointer to a function, you can stick 0 or more asterisks in front of the name during a call on the pointer; they're all irrelevant. Example: void f (void) { printf ("Hello"); } void (*p)(void) = &f; main () { (******************************************************p)(); } Strange. -Peter Klausler, writing compilers at Cray Computer Corp. (not Cray Research)