Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!ll-xn!husc6!seismo!mimsy!chris From: chris@mimsy.UUCP Newsgroups: comp.lang.c Subject: Re: (*pointer_to_function_returning_int)(args) Message-ID: <7088@mimsy.UUCP> Date: Wed, 17-Jun-87 02:22:47 EDT Article-I.D.: mimsy.7088 Posted: Wed Jun 17 02:22:47 1987 Date-Received: Fri, 19-Jun-87 01:05:41 EDT References: <16673@cca.CCA.COM> <7048@mimsy.UUCP> <786@geac.UUCP> Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742 Lines: 31 >In article <7048@mimsy.UUCP> I asked >>Why not ... accept either form? ---the forms being (*f)(x) and f(x), and hence (****f)(x) &c. In article <786@geac.UUCP> daveb@geac.UUCP (Dave Brown) writes: >... the more the compiler does for you, the more it has to guarantee >that what it did will never cause future problems. I daresay this change, considering that it is no change at all to some extant C compilers, is safe. > Friendlyness -> Complexity -> Defaults -> PL/1 I am not sure what the arrows are supposed to mean---implication perhaps? If so, I say only that accepting either form in fact simplifies the compiler, for there is then only one rule for function calls. Precisely, in all contexts save declarations, an object of type `function returning T' is, by finding the object's address, converted to an object of type `pointer to function returning T'. The only value that may appear to the left of the parentheses in a function call is one of type `pointer to function returning T'; the value of the function call is of type T. Do you see why this allows any number of asterisk symbols? (If not, consider: What type results from applying `*' to an object of type `pointer to function returning T'? What must immediately happen to this object?) -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7690) Domain: chris@mimsy.umd.edu Path: seismo!mimsy!chris