Addresses of static functions
jsdy at SEISMO.ARPA
jsdy at SEISMO.ARPA
Mon Feb 25 10:02:36 AEST 1985
Suggestion to make this usable (people who don't understand or WANT to
understand the 80*86 have my full understanding & envy, and may turn to
the next message.):
The problem seems to be that static functions, under VENIX, are
compiled as local to the segment and therefore have a short return
sequence rather than a long return sequence. Well, the '&' unop, when
applied to a function, produces a pointer whose only use is as an
object from which to make an indirect call. It need not be the exact
address in memory of the routine (although debuggers prefer this GREAT-
LY!). Further, a static can only be accessed within its own module
(obviously). Well, let's say that all function-addresses must be long
pointers, and that calls indirected from such pointers must ne long
calls. Well, we can still have local static functions, if we think
it's worth it. Just have, for each static whose address is taken in
the module, a long-return (unnamed) function whose sole purpose is
to copy the args back onto the stack and do a short-call to the static
routine. 'Course, this will cause problems with varargs functions ...
Maybe it would just be better to make all functions long-return
functions.
;-Z
.r .sig
More information about the Comp.lang.c
mailing list