comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@merv.cs.nyu.edu (Robert Dewar)
Subject: Re: Address to function pointer conversion
Date: 1997/06/14
Date: 1997-06-14T00:00:00+00:00	[thread overview]
Message-ID: <dewar.866334272@merv> (raw)
In-Reply-To: 5nrv4p$340m$1@prime.imagin.net


Sam says

<<Depends on how you define "correctly."
 
There is no such conversion defined within the language, because the
language would need some way to verify that this address is the
correct place to enter a routine with the given profile.>>


It is worse than that. There is no guarantee at all that an access to
function value looks anything like an address. 

Indeed, on the list of future enhancements for GNAT is to replace the
current inefficient use of trampolines for pointers to nested functions
by using "fat" pointers that will have two items

1) the address of the code
2) the static link

And this is indeed probably the most sensible data structure to use for
a pointer to a function (it is what is often used in Pascal and PL/1
compilers for example).

This means that even if UC is working today in GNAT on some implementation,
it may suddenly stop working in the future.

What would be helpful is to know why you would want to do such a strange
thing ...
\x1adp





  reply	other threads:[~1997-06-14  0:00 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-06-13  0:00 Address to function pointer conversion Michael Paus
1997-06-13  0:00 ` Samuel Mize
1997-06-14  0:00   ` Robert Dewar [this message]
1997-06-13  0:00 ` John G. Volan
1997-06-14  0:00   ` Robert Dewar
1997-06-17  0:00     ` John G. Volan
1997-06-20  0:00       ` Robert Dewar
1997-06-24  0:00         ` Matthew Heaney
1997-06-24  0:00           ` Robert Dewar
1997-06-25  0:00             ` Michael Paus
1997-06-14  0:00 ` Robert Dewar
1997-06-16  0:00   ` Michael Paus
1997-06-16  0:00     ` Robert Dewar
1997-06-16  0:00       ` Samuel Mize
1997-06-16  0:00         ` Robert A Duff
1997-06-17  0:00         ` Robert Dewar
1997-06-17  0:00           ` Samuel Mize
1997-06-20  0:00             ` Robert Dewar
1997-06-20  0:00             ` Robert Dewar
1997-06-16  0:00     ` Robert A Duff
1997-06-14  0:00 ` Robert A Duff
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox