Addresses of static functions

P. Tucker Withington ptw at encore.UUCP
Tue Feb 26 05:52:00 AEST 1985


>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

Since the static function by def'n can't be seen outside the module, why not
have *it* be the "(unnamed)" function?  Seems even debuggers could live with
that.  If they can live with inverted and non-inverted loops (did you use -O?)
they should be able to deal with direct and "indirect" functions.

Presumably a function declared static should be optimized for "local" use.
Taking the & of it and passing it out of the module, while legal, is perhaps
a bit perverse (although C++ might not agree with that).

Or you could choose a different CPU.

                               o.o      --tucker
                                ~



More information about the Comp.lang.c mailing list