Casting to far proc ptr
Andreas Kaiser
kaiser at ananke.stgt.sub.org
Sat Oct 6 17:35:40 AEST 1990
In a message of <Oct 05 13:58>, Wm E Davidsen Jr (davidsen at crdos1.crd.ge.COM ) writes:
WEDJ> I need to pass to address of a procedure to a called function. The
WEDJ> procedure is near static, and I need to cast to far, or assign the
WEDJ> address to a far ptr.
You cannot call a near function via a far pointer. If you find way to cast the
pointer, the called functions parameters will be addressed wrong and
a return from the called funtion crashes you program. Near functions in a large
model should never be used with function pointers. If you need the pointer, you
should strip off the "near" attribute.
Gruss, Andreas
More information about the Comp.lang.c
mailing list