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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,65b902127ca8a604 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news2.google.com!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!nx01.iad01.newshosting.com!newshosting.com!newspeer.monmouth.com!news.tele.dk!news.tele.dk!small.news.tele.dk!bnewspeer01.bru.ops.eu.uu.net!bnewspeer00.bru.ops.eu.uu.net!emea.uu.net!newsfeed.arcor.de!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Issue with GNAT GPL 2009 and GtkAda Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <4A414EBB.8060204@free.fr> <1avd65rn49abv$.krcxo2gdzb16$.dlg@40tude.net> Date: Fri, 26 Jun 2009 11:14:39 +0200 Message-ID: <1ux3p9a5i2l52.y3yg3rlti1wo$.dlg@40tude.net> NNTP-Posting-Date: 26 Jun 2009 11:14:39 CEST NNTP-Posting-Host: 4f218315.newsspool3.arcor-online.net X-Trace: DXC=iZYhI:GYSEk<6cDJZfMd_cMcF=Q^Z^V3h4Fo<]lROoRa^YC2XCjHcbi1obUf_i?@_gDNcfSJ;bb[eFCTGGVUmh?dLK[5LiR>kgbbM5?KN4Pjbe X-Complaints-To: usenet-abuse@arcor.de Xref: g2news2.google.com comp.lang.ada:6632 Date: 2009-06-26T11:14:39+02:00 List-Id: On Fri, 26 Jun 2009 05:02:27 -0400, Stephen Leake wrote: > "Dmitry A. Kazakov" writes: > >> On Thu, 25 Jun 2009 05:06:08 -0400, Stephen Leake wrote: >> >>> Another thought: whenever I have trouble with anonymous access types, >>> I replace them with the corresponding named access type, and the >>> problem goes away. That may indicate a conmpiler bug, but I've always >>> had to much to do to find out. >> >> Yes, but that is not necessarily a compiler bug. It is quite simple to >> create a serious problem to oneself: >> >> declare >> Ptr : access T := new T; >> begin >> ... >> External_Ptr := Ptr.all'Uchecked_Access; -- Copy the pointer >> ... >> end; -- Now External_Ptr is dangling, because the object is freed. > > Yes, but only because you used "Unchecked". > > The problems I was refering to were compiler-time errors, or runtime > accessibility check failures. Unchecked_Access is used to fight runtime accessibility check. There would be no problem if we could go without Unchecked_Access. It is meaningless accessibility checks make programmers accustomed to Unchecked_Access. It is meaningless treatment of "access T" as an anonymous local type, where the main purpose of anonymous access is to be an equivalent of any access type. It is naive to expect people (even disciplined Ada programmers) to follow all these conceptual shifts. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de