comp.lang.ada
 help / color / mirror / Atom feed
From: Robert Dewar <robert_dewar@my-deja.com>
Subject: Re: Access and alias
Date: 2000/04/07
Date: 2000-04-07T00:00:00+00:00	[thread overview]
Message-ID: <8ckeup$9ed$1@nnrp1.deja.com> (raw)
In-Reply-To: J77H4.418$Qy3.109837@news.pacbell.net

In article <J77H4.418$Qy3.109837@news.pacbell.net>,
  tmoran@bix.com wrote:

> As I understand it, if a function has an access type as a
> parameter, and has a "pragma import", then the compiler is
> required to do whatever might be necessary to convert its idea
> of an access value in Ada to the called language's idea of an
> access value.

This is actually quite wrong from a pure language point of
view, there is absolutely no reason why a convention Ada
access type should look anything like a pointer.

What you say above is strictly only true if the type is
declared to have Convention C on the Ada side.

If the compiler DID use a different representation for the
two, I would say your prescription would be quite wrong, there
is absolutely no requirement in the RM for such conversions,
and pragmatically it would be a bad idea to molest parameters
in this way.

In practice compilers usually use the same representation for
convention Ada and convention C access values, at least for
all cases except pointer-to-unconstrained, so the issue of
conversion does not arise, and that is probably where Tom's
misunderstanding comes from (i.e. this pretty serious
misunderstanding does not affect things most of the time).



Sent via Deja.com http://www.deja.com/
Before you buy.




  reply	other threads:[~2000-04-07  0:00 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-04-04  0:00 Access and alias NANCY HEHIR
2000-04-04  0:00 ` Laurent Guerby
2000-04-04  0:00   ` NANCY HEHIR
2000-04-04  0:00     ` Laurent Guerby
2000-04-05  0:00       ` Alfred Hilscher
2000-04-05  0:00         ` Laurent Guerby
2000-04-05  0:00         ` Ted Dennison
2000-04-05  0:00           ` Jeff Carter
2000-04-06  0:00             ` Robert Dewar
2000-04-07  0:00               ` Jeff Carter
2000-04-06  0:00             ` Alfred Hilscher
2000-04-07  0:00               ` Jeff Carter
2000-04-06  0:00           ` Robert Dewar
2000-04-06  0:00           ` tmoran
2000-04-07  0:00             ` Robert Dewar [this message]
2000-04-07  0:00               ` tmoran
2000-04-09  0:00                 ` Robert Dewar
2000-04-09  0:00                   ` tmoran
2000-04-10  0:00                 ` Jack W. Sharer
2000-04-05  0:00     ` Jeffrey D. Cherry
2000-04-04  0:00 ` tmoran
replies disabled

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