Compiler bug

Joaquim Martillo martillo at mit-athena.UUCP
Thu May 9 13:29:24 AEST 1985


extern int usr1(), usr2(), usr3();

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

Should not compile (with compiler errors not liner errors) since you
have an illegal combination of pointers and integers.  The proper
way to do this is:

extern int usr1(), usr2(), usr3();

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

which should be fairly obvious if you think about it.  There are of
course misimplementations of the C compiler floating around.



More information about the Comp.bugs.4bsd.ucb-fixes mailing list