Ptr to func doesn't like casting??

greenber at acf4.UUCP greenber at acf4.UUCP
Sat Dec 1 00:29:00 AEST 1984


<>


Okay....I've received about three million, two hunderd and six responses
regarding this casting question.  Thank you one and all.

Everybody told me basically the same thing:

	(int (*)())  is the way to cast.

Then they cast(igated) me for using a non-portable cast.  Some indicated
that the primary problem of this cast was that the ptr to function is
supposed to point to instruction space and might barf if it points to
data space on a machine that cares (I&D --- where have I heard that before?).

A few indicated that I should really use unions.  That's a nogo, since
I use the structure that this is a part of as an initializer.

But I've tried this casting on every machine that I can get my hands on
and it seems to work  (either that or that cast turns on the "shut-up"
flag automagically in lint! :-) ) .  I would be interested in finding out
what machines it WILL NOT work on.

Thanks again, guys!!


Ross M. Greenberg  @ NYU   ---->  allegra!cmcl2!acf4!greenber  <----



More information about the Comp.lang.c mailing list