Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/5/84; site sjuvax.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!sjuvax!jss From: jss@sjuvax.UUCP (J. Shapiro) Newsgroups: net.unix,net.bugs.4bsd,net.lang.c Subject: Bug in 4.2BSD C compiler... Message-ID: <1141@sjuvax.UUCP> Date: Wed, 8-May-85 17:42:51 EDT Article-I.D.: sjuvax.1141 Posted: Wed May 8 17:42:51 1985 Date-Received: Thu, 9-May-85 03:19:39 EDT Distribution: net Organization: St. Joseph's University, Phila. PA. Lines: 37 Xref: watmath net.unix:4455 net.bugs.4bsd:1504 net.lang.c:5175 About two days ago I posted an article complaining that the following compiled incorrectly under 4.2: int usr1(), usr2(), usr3(); int procs[] = { usr1, usr2, usr3 } Of course it doesn't compile, but I mistyped what I wanted. Several people sent suggestions, and my thanks to all of them. The piece of code which doesn't compile and should is as follows: ---- correctly typed version ---- int usr1(), usr2(), usr3(); int *procs[] = { usr1, usr2, usr3 }; --------------------------------- Now, several people observed that int (*procs[])() = ... will work, and this is correct. 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. Would someone be good enough to try this on System V and tell me if the silly thing typed correctly compiles? I don't want to make this a religious battle - I will use what works, but it did strike me as curious that three of the four C compilers I use regularly take this without complaint, and that the loser was 4.2BSD. Is this version right or wrong? Thanks....