Compiler bug
Ed Gould
ed at mtxinu.UUCP
Fri May 10 10:39:32 AEST 1985
> 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
It seems to me that the second declaration should be
int (*(usrprocs()))[] = { usr1, usr2, usr3 };
/* | ||||
* | |----------||
* |-------------|
*/
since usr[123] are, in this context, *pointers* to functions.
I couldnt get that to compile either, though.
--
Ed Gould mt Xinu, 2910 Seventh St., Berkeley, CA 94710 USA
{ucbvax,decvax}!mtxinu!ed +1 415 644 0146
More information about the Comp.unix
mailing list