Compiler bug

Jonathan Biggar jonab at sdcrdcf.UUCP
Thu May 9 01:39:55 AEST 1985


In article <1136 at sjuvax.UUCP> jss at 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.

It won't compile under 4.2bsd because the code is WRONG!  The array should
be declared as:

int	(*usrprocs[])() = { usr1, usr2, usr3 };

Jon Biggar
{allegra,burdvax,cbosgd,hplabs,ihnp4,sdccsu3}!sdcrdcf!jonab



More information about the Comp.unix mailing list