comp.lang.ada
 help / color / mirror / Atom feed
From: dog.ee.lbl.gov!overload.lbl.gov!agate!spool.mu.edu!wupost!usc!rpi!sarah!c
Subject: Re: Pointer help
Date: 16 Apr 92 20:59:25 GMT	[thread overview]
Message-ID: <1992Apr16.155925.145@v7.vitro.com> (raw)

In article <1992Apr16.135211.144@v7.vitro.com>, carmencs@vitro.com (Carmen Cast
ells-Schofield) writes:
> 
> 	Can anyone tell me any way to get a pointer to point to a declared data
> item rather than an allocated location?   Perhaps with a 'ADDRESS?   Does thi
s 
> require UNCHECKED_CONVERSION:), or what?

Since I happen to know you're running on a VAX, I'll answer for that platform.

Try page 2-22 of the Run Time Reference Manual.  Basically, you can use
an Unchecked_Conversion, but to be safe, the access type must access a
record type.  It is unclear from that reference whether the operand of
the 'ADDRESS attribute must also be a record type.  From the LRM, section
13.7.2, however, it seems clear that the result of the 'ADDRESS attribute
reliably indicates the location of a data item (rather than a descriptor
thereof) and no such restriction should exist.

Since the Run Time manual contains an example on page 10-2 of using
Unchecked_Conversion between a pointer to an integer and an integer
variable 'ADDRESS, it seems unlikely you would have problems with
scalars.  Clearly, arrays and especially unconstrained arrays would need
to be encapsulated in records.

	John Briggs			vaxs09@v7.vitro.com

             reply	other threads:[~1992-04-16 20:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1992-04-16 20:59 dog.ee.lbl.gov!overload.lbl.gov!agate!spool.mu.edu!wupost!usc!rpi!sarah!c [this message]
  -- strict thread matches above, loose matches on Subject: below --
1992-04-27 16:39 Pointer help sun-barr!cs.utexas.edu!usc!rpi!bu.edu!inmet!inmet!spock!stt
1992-04-20 15:42 David Emery
1992-04-16 18:52 iggy.GW.Vitalink.COM!psinntp!psinntp!vitro.com!v7.vitro.com!eswgcc
replies disabled

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