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,dc1fff2721602dfa X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit X-Received: by 10.66.84.164 with SMTP id a4mr1740154paz.26.1359671062819; Thu, 31 Jan 2013 14:24:22 -0800 (PST) Path: 6ni27867pbd.1!nntp.google.com!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!nx02.iad01.newshosting.com!newshosting.com!news-out.readnews.com!transit3.readnews.com!panix!newsfeed-00.mathworks.com!nntp.TheWorld.com!.POSTED!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Ada and string literals Date: Thu, 31 Jan 2013 17:24:22 -0500 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <4978d638-a04b-4561-85e9-cf6620265af2@googlegroups.com> <86boc63n5d.fsf@gaheris.avalon.lan> <619a9cd8-ba12-4d25-b1b9-de30d416b54a@googlegroups.com> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 X-Trace: pcls6.std.com 1359671062 5762 192.74.137.71 (31 Jan 2013 22:24:22 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Thu, 31 Jan 2013 22:24:22 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:m4ltOmEryQQfPL4S8diGuozJSKo= X-Received-Bytes: 2658 Content-Type: text/plain; charset=us-ascii Date: 2013-01-31T17:24:22-05:00 List-Id: Adam Beneschan writes: > On Wednesday, January 30, 2013 6:23:08 PM UTC-8, Robert A Duff wrote: > >> '[Unchecked_]Access is about object identity. >> On the other hand 'Address is not -- two objects can have >> the same address without being the same object. > > However, if two objects have the same 'Address, it's hard to imagine > them not having the same 'Access as well, in practice. It's easy to imagine that 'Access is illegal. ;-) That was part of my point: a compiler can place two objects at the same address if they are not aliased. For example, if one of them has zero size. And I wasn't thinking about the case where the user FORCES the same address as in your example below. >... There aren't many cases where this is an issue, but: > > procedure P (Addr : in System.Address) is > > X : aliased T; > for X'Address use Addr; > pragma Import (Ada, X); ... > Assuming T is a simple record type, for instance, I can't imagine > XA=YA being false in any implementation, even though I believe X and Y > are distinct objects by the RM's definitions. For sure. Are X and Y distinct objects? I'd say the correct answer is "Who cares?" ;-) Maybe this is a bug in the RM, but I hope nobody pesters the ARG about it. IMHO, bugs in the RM should be reported to ARG only if fixing them would change some compiler writer's behavior, or change some programmer's behavior. - Bob