Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site bu-cs.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!panda!talcott!harvard!bu-cs!root From: root@bu-cs.UUCP (Barry Shein) Newsgroups: net.unix,net.bugs.4bsd Subject: Re: Compiler bug Message-ID: <384@bu-cs.UUCP> Date: Tue, 7-May-85 17:30:11 EDT Article-I.D.: bu-cs.384 Posted: Tue May 7 17:30:11 1985 Date-Received: Thu, 9-May-85 01:44:50 EDT References: <1136@sjuvax.UUCP> Organization: Boston Univ Comp. Sci. Lines: 18 Xref: watmath net.unix:4446 net.bugs.4bsd:1502 >From: jss@sjuvax.UUCP (J. Shapiro) >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 } >... Would someone be good enough to check this out on a sysV machine? I believe it won't compile because it's wrong, try: extern int usr1(), usr2(), usr3() ; int (*usrprocs[])() = { usr1, usr2, usr3 } ; ie. that isn't an array of ints, it's an array of pointers to functions returning int (phew.) If other compilers aren't complaining, they're being lazy and not doing their job. Confusing ints with pointers is a classic port problem. -Barry Shein, Boston University