&function, one last time

Chris Koenigsberg ckk at g.cs.cmu.edu
Thu Mar 27 09:03:58 AEST 1986


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 at g.cs.cmu.edu , or ckk%andrew at 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



More information about the Comp.lang.c mailing list