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: Mon, 23 Jan 2017 14:40:08 -0600 Organization: JSA Research & Innovation Message-ID: References: NNTP-Posting-Host: rrsoftware.com X-Trace: franka.jacob-sparre.dk 1485204009 7509 24.196.82.226 (23 Jan 2017 20:40:09 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Mon, 23 Jan 2017 20:40:09 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Response X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Xref: news.eternal-september.org comp.lang.ada:33136 Date: 2017-01-23T14:40:08-06:00 List-Id: "G.B." wrote in message news:o61qau$ock$1@dont-email.me... >A SO answer (41746244) has given rise to the question of whether > or not a compiler implementer may make a renamed object a copy > of the original. (Layman's assumptions from LRM 3.1(7), 8.5.1), Logically, the item is not a copy. How the compiler implements that, however, is its business. > So, is the following program, modifying compoments of and array, > ever allowed to raise Renaming_Is_Copying? Of course. The program has nothing to do with copying that I can see. ... > begin > if X'Address = Stuff (K)'Address then The meaning of X'Address is implementation-defined (as someone said, consider what happens if X is allocated in a register). It's best if its use is limited to the sort of low-level purposes for which it was defined (that is, handling memory-mapped hardware). Note in particular 13.3(16): if the objects in question aren't "aliased", the result of 'Address may not be "useful". If the objects are aliased, then you don't need to use 'Address to get the answer to your question: if X'Access = Stuff (K)'Access then would answer your question (but you might need to declare an appropriate access type somewhere). Note that the compiler would strip off any funny business for this latter case. 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). Randy.