comp.lang.ada
 help / color / mirror / Atom feed
From: Jeffrey Carter <spam.jrcarter.not@spam.not.acm.org>
Subject: Re: System.Address to Access to function/procedure conversion
Date: Sun, 28 Jul 2013 10:19:18 -0700
Date: 2013-07-28T10:19:18-07:00	[thread overview]
Message-ID: <kt3jem$cmp$1@dont-email.me> (raw)
In-Reply-To: <kt3d9j$vmp$1@adenine.netfront.net>

On 07/28/2013 08:27 AM, Tarek Ghaleb wrote:
>
> As for why not just pass an Access to the function directly, the
> Address is actually passed to a C function which later passes it back
> to Ada.

If you want any semblance of portability, then you should never pass an Address 
to C. You should only pass a C-convention access type. The value must be stored 
as a pointer on the C side, and there is no guarantee that Ada's Address has any 
relationship to a C pointer. A C-convention access type, on the other hand, is 
guaranteed to make sense as a C pointer.

-- 
Jeff Carter
"Oh Lord, bless this thy hand grenade, that with it thou
mayst blow thine enemies to tiny bits, in thy mercy."
Monty Python and the Holy Grail
24

  parent reply	other threads:[~2013-07-28 17:19 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-28 15:27 System.Address to Access to function/procedure conversion Tarek Ghaleb
2013-07-28 16:14 ` Dmitry A. Kazakov
2013-07-28 19:05   ` Tarek Ghaleb
2013-07-28 19:23     ` Simon Wright
2013-07-28 22:03       ` Tarek Ghaleb
2013-07-28 20:03     ` Dmitry A. Kazakov
2013-07-28 21:13     ` Shark8
2013-07-28 22:54       ` Tarek Ghaleb
2013-07-29  3:27         ` Shark8
2013-07-29  7:06           ` Tarek Ghaleb
2013-07-28 17:19 ` Jeffrey Carter [this message]
2013-07-28 19:05   ` Tarek Ghaleb
2013-07-28 20:04     ` Jeffrey Carter
2013-07-28 21:31 ` Maciej Sobczak
2013-07-29  6:26   ` Tarek Ghaleb
replies disabled

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