Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83 (MC840302); site log-hb.UUCP Path: utzoo!linus!philabs!cmcl2!seismo!mcvax!enea!log-hb!hans From: hans@log-hb.UUCP (Hans Albertsson) Newsgroups: net.unix,net.bugs.4bsd Subject: Re: Compiler bug Message-ID: <268@log-hb.UUCP> Date: Thu, 9-May-85 09:53:22 EDT Article-I.D.: log-hb.268 Posted: Thu May 9 09:53:22 1985 Date-Received: Sun, 12-May-85 02:05:44 EDT References: <1136@sjuvax.UUCP> Reply-To: hans@log-hb.UUCP (Hans Albertsson) Distribution: net Organization: TeleLOGIC Nyn{shamn SWEDEN Lines: 37 Xref: linus net.unix:3877 net.bugs.4bsd:1214 In article <1136@sjuvax.UUCP> jss@sjuvax.UUCP (J. Shapiro) writes: >I recently noticed that the following will not compile correctly on a >4.2 BSD system: > >extern int usr1(), usr2(), usr3(); > >int usrprocs[] = { usr1, usr2, usr3 } > >whereas it compiles correctly on intel machines, cromix, and Aztec C. >It seems to me that this is something the linker should be able to handle >correctly, and therefore should not be a bug. > >Comments? > >Would someone be good enough to check this out on a sysV machine? > >Jon I don't think your declaration is quite correct; Shouldnt it have been int (usrprocs[])() = { usr1, usr2, usr3 } ? This declares an array of functions returning integer, which is what the objects usrn might be considered to be, while your declaration says array of integer. Not even my version is quite correct. I ususally say int ( *usrprocs[] )() = { usr1 ... to get the proper effect, since ( to quote K&R ) " if a function name appears in an expression, not in the position of a function call, a pointer to the function is generated." -- Hans Albertsson, USENET/uucp: {decvax,philabs}!mcvax!enea!log-hb!hans Real World: TeleLOGIC AB, Box 1001, S-14901 Nynashamn,SWEDEN