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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.107.128.200 with SMTP id k69mr2229909ioi.51.1520728702111; Sat, 10 Mar 2018 16:38:22 -0800 (PST) X-Received: by 10.157.68.105 with SMTP id f38mr181602otj.1.1520728702021; Sat, 10 Mar 2018 16:38:22 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!border1.nntp.ams1.giganews.com!nntp.giganews.com!peer03.ams1!peer.ams1.xlned.com!news.xlned.com!peer02.am4!peer.am4.highwinds-media.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!e10-v6no795807itf.0!news-out.google.com!a2-v6ni2395ite.0!nntp.google.com!e10-v6no795806itf.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sat, 10 Mar 2018 16:38:21 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=173.71.218.250; posting-account=QF6XPQoAAABce2NyPxxDAaKdAkN6RgAf NNTP-Posting-Host: 173.71.218.250 References: <4ab69a18-5766-446c-85c2-14e094199c95@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <6792fcd7-a25a-417c-b45a-1a17b0168234@googlegroups.com> Subject: Re: Ada Alternatives to Unrestricted_Access From: Jere Injection-Date: Sun, 11 Mar 2018 00:38:22 +0000 Content-Type: text/plain; charset="UTF-8" X-Received-Bytes: 2319 X-Received-Body-CRC: 1771917258 Xref: reader02.eternal-september.org comp.lang.ada:50922 Date: 2018-03-10T16:38:21-08:00 List-Id: On Friday, March 9, 2018 at 11:46:03 AM UTC-5, Jeffrey R. Carter wrote: > On 03/09/2018 01:36 AM, Jere wrote: > > > > It generates the error "access-to-variable designates constant" because > > the function takes a parameter of mode "in" while the iterator needs > > a non-constant access to the variable. I can't change the mode of the > > function for other reasons. > > OK, that's what I missed. I guess you could unchecked convert from > access-constant to access-all. > My only concern with this is does the Ada language allow it portably? I know it works in GNAT, but what I couldn't find is if the RM allowed for a constant variable to have a different internal representation than a non constant version of the variable. If that were the case, then I would be worried that doing an unchecked_conversion (or an Address_To_Access_Conversion) could provide an erroneous result. I've been dipping into the RM but haven't found what I am looking for yet.