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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!nntp-feed.chiark.greenend.org.uk!ewrotcd!reality.xs3.de!news.jacob-sparre.dk!franka.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Does object renaming allow the view to be a copy? Date: Tue, 24 Jan 2017 15:08:27 -0600 Organization: JSA Research & Innovation Message-ID: References: <1554966b-2882-4f1f-8cc8-be5a03e44ad0@googlegroups.com> NNTP-Posting-Host: rrsoftware.com X-Trace: franka.jacob-sparre.dk 1485292108 20358 24.196.82.226 (24 Jan 2017 21:08:28 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Tue, 24 Jan 2017 21:08:28 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Xref: news.eternal-september.org comp.lang.ada:33146 Date: 2017-01-24T15:08:27-06:00 List-Id: "Robert Eachus" wrote in message news:1554966b-2882-4f1f-8cc8-be5a03e44ad0@googlegroups.com... > On Monday, January 23, 2017 at 3:40:10 PM UTC-5, Randy Brukardt wrote: > >> IMHO, 'Address should only appear in a program that is interfacing to >> some >> memory-mapped entity; else use some form of 'Access (or >> 'Unchecked_Access). > > Hmm. My code has cases of: > for X'Address use at mod 4; Looks like you are trying to set Alignment which Ada 83 didn't have. Set alignment directly, so your reader knows what you're doing. > I've also broken abstractions by using 'Address to obtain access to the > details > of an otherwise private type--those are old, and can be updated to use > child packages. Correct. > I also seem to recall that a lot of the NUMWG work uses address clauses > when pulling > floating point numbers apart--and putting them back together. Ada 95 says that Unchecked_Conversion can be by-reference, so the performance reason for not using UC in this case doesn't exist (assuming a friendly implementer). UC also doesn't force a compiler to abandon many useful optimizations (or do horrible analysis before allowing it). > and I also have some mixed Fortran and Ada that uses at Foo'Address + 24 > or the like to deal with > Fortran common blocks that are really overlays. (For example, one > declaration has the common block > as an array, another converts it to a vector.) This falls under "interfacing to some memory-mapped entity"; I purposely didn't say "hardware" because sometimes software needs it too. > Are all of these deprecated now? All but the last can be done better with other constructs, IMHO. For the last, it's case-by-case what the best approach would be: you might need 'Address. Randy.