comp.lang.ada
 help / color / mirror / Atom feed
From: tmoran@acm.org
Subject: Re: C array to ada record interface
Date: Thu, 29 Jul 2004 05:56:27 GMT
Date: 2004-07-29T05:56:27+00:00	[thread overview]
Message-ID: <fk0Oc.189247$JR4.48976@attbi_s54> (raw)
In-Reply-To: 0ZudnShYIIM3j5rcRVn-uA@comcast.com

>>     package B_Ptr_Conversion is new System.Address_To_Access_Conversions(B);
>>     pragma Convention (C, B_Ptr_Conversion.Object_Pointer);
>> is not legal.
> If the Ada compiler uses the same type of addresses as the C
>compiler there is no problem.  But if you have a 64-bit Ada compiler and
>a 32-bit C compiler (or vice-versa) it can't work.

  Presumably a 64 bit Ada compiler could be designed to work with a 32 bit
C compiler, with pragma Convention(C, an_access_type) causing
an_access_type to be a 32 bit pointer (with implied additional 32 bits
from a segment or base or just zero, for instance) rather than a 64 bit
pointer.  Such a compiler ought to be able to do System.Address <-> access
type conversions for 32 bit, as well as 64 bit, access types, but Ada's
System.Address_To_Access_Conversions could only work for one of those,
right?  Perhaps the vendor of such a compiler would offer (non-standard)
package System.Address_To_Access_Conversions.C
for doing the (32 bit or convention C) conversions.



  reply	other threads:[~2004-07-29  5:56 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-14 23:17 C array to ada record interface Francisco Javier Loma Daza
2004-07-15  0:36 ` Brian May
2004-07-15  1:23 ` Jeffrey Carter
2004-07-22 18:02   ` Francisco Javier Loma Daza
2004-07-24 18:48     ` Ludovic Brenta
2004-07-25 17:26       ` Francisco Javier Loma Daza
2004-07-25 19:28       ` tmoran
2004-07-26 21:42         ` Ludovic Brenta
2004-07-27 21:04           ` tmoran
2004-07-27 22:15             ` Martin Dowie
2004-07-28  2:42             ` Robert I. Eachus
2004-07-29  5:56               ` tmoran [this message]
2004-07-29 19:58                 ` Robert I. Eachus
replies disabled

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