comp.lang.ada
 help / color / mirror / Atom feed
From: dog.ee.lbl.gov!agate!howland.reston.ans.net!math.ohio-state.edu!magnus.ac
Subject: Re: Data Overlays
Date: 31 Aug 93 20:36:04 GMT	[thread overview]
Message-ID: <1993Aug31.203604.29444@iplmail.orl.mmc.com> (raw)

In article 29091@software.org, smithd@software.org (Doug Smith) writes:
>In article <1993Aug18.125540.1393@iplmail.orl.mmc.com> rgilbert@orl.mmc.com wr
ites:
>>
>>As far as the technique of:
>>
>>       X : TYPE_1;
>>       Y : TYPE_2;
>>       for Y use at X'address;
>>
>>The LRM 13.5 states that address clauses should not be used to achieve overla
ys
>>of objects...  Any program using address clauses to achieve such effects is
>>erroneous.  What is the rationale for this?
>>
>> [stuff deleted]
>>
>>                             Bob
>
>
>And...if you use this technique, don't forget what happens when the
>variable is elaborated:
>
>   procedure P(X : Some_Type) is
>      Y : Some_Pointer_Type; -- or record with initialization
>      for Y use at X'Address;
>   begin
>      -- Y has likely been initialized to null, and X has probably
>      -- been changed.  But, since this program is erroneous,
>      -- it is fine for the compiler to do whatever it wants ;^)
>   end;
>   
>Doug
>smithd@software.org

Absolutely, and somewhat unrelated to data overlays...

   I have experienced this and it can be a problem when attempting to
   map to read-only (VME bus system) addresses.  Since most compilers
   will attempt to initialize objects using representation clauses,
   during program elaboration the resulting write to the address
   results in a VME bus error.  The solution is to use access types
   and assign the address to the access object using Unchecked_Conversion.
   This BTW, is similar to the other method I have used for implementing
   data overlays.

                     Bob

             reply	other threads:[~1993-08-31 20:36 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1993-08-31 20:36 dog.ee.lbl.gov!agate!howland.reston.ans.net!math.ohio-state.edu!magnus.ac [this message]
  -- strict thread matches above, loose matches on Subject: below --
1993-09-01 14:36 Data Overlays David Emery
1993-09-01  4:23 Jim Lonjers
1993-08-31  3:51 Jim Lonjers
1993-08-23 14:17 Bob Crispen
1993-08-23 14:11 Alex Blakemore
1993-08-19 13:16 cs.utexas.edu!mars.tsd.arlut.utexas.edu!gardner
1993-08-19  2:18 portal!cup.portal.com!R_Tim_Coslet
1993-08-18 16:40 cis.ohio-state.edu!magnus.acs.ohio-state.edu!csn!news.den.mmc.com!iplmail
1993-08-18 16:27 Charles H. Sampson
1993-08-18 16:04 Charles H. Sampson
1993-08-18 12:55 cis.ohio-state.edu!magnus.acs.ohio-state.edu!csn!news.den.mmc.com!iplmail
1993-08-18 12:50 cis.ohio-state.edu!math.ohio-state.edu!howland.reston.ans.net!europa.eng.gtefsd.com!fs7.ece.cmu.edu!news.sei.cmu.edu!firth
1993-08-18  2:11 cis.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!agate!do
1993-08-18  1:53 cis.ohio-state.edu!magnus.acs.ohio-state.edu!math.ohio-state.edu!howland.
1993-08-18  0:39 cis.ohio-state.edu!magnus.acs.ohio-state.edu!math.ohio-state.edu!cs.utexa
1993-08-17 15:16 Charles H. Sampson
1993-08-13 17:57 cgl!sgiblab!darwin.sura.net!mlb.semi.harris.com!x102a!scook
1993-08-13 12:48 Bob Gilbert
replies disabled

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