[net.lang.c] &function, one last time

ckk@g.cs.cmu.edu (Chris Koenigsberg) (03/27/86)

One last data point concerning the discussion of pointers to functions.....
someone mentioned that you could point to a function on a Vax, but not
on a PDP-11. Since I'm one of the few non-IBM people in the world with
an RT in my office, especially one running 4.2 rather than (sys V) AIX,
I can add that you can't do it on an RT either, according to the following:
I just got a copy of the "4.2A Linkage Convention" for the 4.2 kernel
on the IBM RT PC, and I quote from page 3, under "The Data Area":
	"A value &foo of type pointer to function corresponds to the address 
of _foo, the function's data area, not the address of _.foo, the function's
entry point. A program that does arithmetic on function pointers, assuming 
that  they address entry points, will probably malfunction."

Chris Koenigsberg
ckk@g.cs.cmu.edu , or ckk%andrew@pt.cs.cmu.edu
{harvard,seismo,topaz,ucbvax}!g.cs.cmu.edu!ckk
Center for Design of Educational Computing
Carnegie-Mellon U.
Pgh, Pa. 15213