Bug in 4.2BSD C compiler...

Ken Montgomery kjm at ut-ngp.UUCP
Fri May 10 01:01:14 AEST 1985


>[jss at sjuvax (J. Shapiro)]
>
> [...]
>
>int usr1(), usr2(), usr3();
>
>int *procs[] = { usr1, usr2, usr3 };
>
>---------------------------------
>
>Now, several people observed that
>
>int (*procs[])() = ...
>
>will work, and this is correct.  The question arises on the basis of K&R
>pp 114-115, which would seem to indicate that my declaration is acceptable
>on the grounds that pointers to integers and pointers to functions returning
>integers are supposed to be equationally indistinguishable.

I don't understand how you read those pages of K&R and came to your
conclusion.  I don't see anything there that says that integers and
pointers to functions returning integers are "indistinguishable".

--
The above viewpoints are mine.  They are unrelated to
those of anyone else, including my cats and my employer.

Ken Montgomery  "Shredder-of-hapless-smurfs"
...!{ihnp4,allegra,seismo!ut-sally}!ut-ngp!kjm  [Usenet, when working]
kjm at ut-ngp.ARPA  [for Arpanauts only]



More information about the Comp.lang.c mailing list