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.84.8 with SMTP id i8mr18019430iob.66.1520479125996; Wed, 07 Mar 2018 19:18:45 -0800 (PST) X-Received: by 10.157.4.22 with SMTP id 22mr1291076otc.2.1520479125768; Wed, 07 Mar 2018 19:18:45 -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!peer02.ams1!peer.ams1.xlned.com!news.xlned.com!peer01.am4!peer.am4.highwinds-media.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!e10no533076itf.0!news-out.google.com!a25ni1042itj.0!nntp.google.com!e10no533072itf.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Wed, 7 Mar 2018 19:18:45 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=2a02:1206:45c6:8b20:6436:ad6b:48bf:4ab9; posting-account=gRqrnQkAAAAC_02ynnhqGk1VRQlve6ZG NNTP-Posting-Host: 2a02:1206:45c6:8b20:6436:ad6b:48bf:4ab9 References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <79006263-c9a7-497a-af50-de9e5045af07@googlegroups.com> Subject: Re: Ada Alternatives to Unrestricted_Access From: gautier_niouzes@hotmail.com Injection-Date: Thu, 08 Mar 2018 03:18:45 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Received-Bytes: 2372 X-Received-Body-CRC: 1690299163 Xref: reader02.eternal-september.org comp.lang.ada:50892 Date: 2018-03-07T19:18:45-08:00 List-Id: I had the same problem for GL[U[T]] bindings (work on both GNAT and ObjectA= da, and perhaps other Ada systems) [1]. A quick search with AZip (shameless= plug :-) [2] leads to=20 package A2A_double is new System.Address_To_Access_Conversions(Double); ... procedure Vertex (v: Double_Vector_3D) is begin Vertex3dv(A2A_double.To_Pointer(v(0)'Address)); -- This method is functionally identical -- to using GNAT's 'Unrestricted_Access end Vertex; Other places use an Unchecked_Conversion. The GNAT doc says: "The Unrestricted_Access attribute is similar to Access except that all acc= essibility and aliased view checks are omitted. This is a user-beware attri= bute. It is similar to Address, for which it is a desirable replacement whe= re the value desired is an access type. In other words, its effect is ident= ical to first applying the Address attribute and then doing an unchecked co= nversion to a desired access type." ___ [1] https://globe3d.sourceforge.io/ [2] https://azip.sourceforge.io/