Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site mtxinu.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxt!houxm!vax135!cornell!uw-beaver!tektronix!zehntel!vlsvax1!qantel!dual!unisoft!mtxinu!ed From: ed@mtxinu.UUCP (Ed Gould) Newsgroups: net.unix,net.bugs.4bsd,net.lang.c Subject: Re: Bug in 4.2BSD C compiler... Message-ID: <376@mtxinu.UUCP> Date: Sat, 11-May-85 02:04:22 EDT Article-I.D.: mtxinu.376 Posted: Sat May 11 02:04:22 1985 Date-Received: Tue, 14-May-85 23:47:46 EDT References: <1141@sjuvax.UUCP> Distribution: net Organization: mt Xinu, Berkeley, CA Lines: 41 Xref: watmath net.unix:4502 net.bugs.4bsd:1519 net.lang.c:5205 > The question arises on the basis of K&R > pp 114-115, which would seem to indicate that my declaration is acceptable > on the grounds that pointers to integers and pointers to functions returning > integers are supposed to be equationally indistinguishable. ??? I sure don't read it that way. What you may be misreading is that a declaration of a function, e.g. int funct(); is in effect declaring funct to be, in some semantic equivalency sort of way, to be a pointer to a function. The sequence f() { int f2(); int (*f3)(); f3 = f2; (*f3)(); } is reasonable and legal; the sequence f() { int f2(); int *f3(); f3 = f2; (*f3)(); } makes no real sense. The key is that () binds tighter than *. Of course, *f3(); (assuming that f3 is a function returning a pointer) is also reasonable, but has *very* different meaning. -- Ed Gould mt Xinu, 2910 Seventh St., Berkeley, CA 94710 USA {ucbvax,decvax}!mtxinu!ed +1 415 644 0146