comp.lang.ada
 help / color / mirror / Atom feed
From: mg@asp.camb.inmet.com (Mitch Gart)
Subject: Re: Access type representations.
Date: Fri, 28 Oct 1994 17:03:12 GMT
Date: 1994-10-28T17:03:12+00:00	[thread overview]
Message-ID: <CyE7DD.5J8@inmet.camb.inmet.com> (raw)
In-Reply-To: 9410281131.AA15384@eurocontrol.de

Bob Wells #402 (wel@EUROCONTROL.DE) wrote:

I have heard of compilers where an object of type "access string"
points to the string descriptor, rather than to the first 
character of the string.  Then the contents of the string are
reachable from the descriptor, either by being right next to the
descriptor in memory or through another level of indirection.

So I'm not sure what the answer would be to this question:

: Getting back to that thread of using access types to interface with
: pointers in C, David emery said that my assumption that the access
: type in Ada does not necessarily have to contain the address.

In this case, 

- yes, the Ada access object is a 32-bit address of a part of the 
  object, like a C pointer, but 
  
- no, the Ada access object doesn't contain the address of the 
  first character of the string like the C pointer.

If you want to pass the address of an Ada string to a C function,

    func(s(s'first)'address)

should work for all compilers.

	Mitch Gart



  parent reply	other threads:[~1994-10-28 17:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1994-10-28 11:31 Access type representations Bob Wells #402
1994-10-28 13:36 ` Tucker Taft
1994-10-28 16:52   ` Robert Dewar
1994-10-28 17:03 ` Mitch Gart [this message]
1994-10-30 16:02   ` Robert Dewar
1994-11-01 13:57   ` Keith Thompson
  -- strict thread matches above, loose matches on Subject: below --
1994-11-02  7:53 Bob Wells #402
replies disabled

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