From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,7f18265ce67560b3 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,UTF8 Received: by 10.68.59.229 with SMTP id c5mr229177pbr.6.1320756259278; Tue, 08 Nov 2011 04:44:19 -0800 (PST) Path: h5ni12517pba.0!nntp.google.com!news1.google.com!goblin1!goblin.stu.neva.ru!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Memory Access Date: Tue, 08 Nov 2011 12:44:17 +0000 Organization: A noiseless patient Spider Message-ID: References: <49f9578c-6f67-4af0-93b0-63120bfe23df@x28g2000prb.googlegroups.com> Mime-Version: 1.0 Injection-Info: mx04.eternal-september.org; posting-host="dFCm8HWntFqmDIilBLqEJQ"; logging-data="17165"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18lPbsP//BQYJSA73enaLK6JusIKM9MvUI=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (darwin) Cancel-Lock: sha1:C26ASxPuaDjfIZIlkpkU9kisbM4= sha1:L/SJZ/gCEt9/qkCKdY/axlnH/iE= Xref: news1.google.com comp.lang.ada:18858 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Date: 2011-11-08T12:44:17+00:00 List-Id: Adam Beneschan writes: > On Nov 7, 3:13 pm, Simon Wright wrote: >> Adam Beneschan writes: >> >     declare >> >        Dev_Table : Dev_Table_Type (1 .. Num_Devs_Cnst); >> >        for Dev_Table'Address use Data_Address; >> >     begin >> >        -- and you can use Dev_Table in here >> >     end; >> >> One thing to be wary of here is that Dev_Table might contain initialised >> components. >> >>    type Integer_P is access all integer; >>    type Rec is record >>       I : Integer_P; >>    end record; >>    R : Rec; >>    for R'Address use ...; >> >> may well get R.I initialised to null. >> >> I don't know whether it's a GNAT convention, but the way to avoid this >> in GNAT is to add >> >>    pragma Import (Ada, R); > > Yes, I forgot that; my example above should include pragma Import > (Ada, Dev_Table). I think this is in the RM. It isn't GNAT-specific. ARM05 B.1(38) - http://www.adaic.org/resources/add_content/standards/05aarm/html/AA-B-1.html#I7050