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-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news2.google.com!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post02.iad.highwinds-media.com!news.flashnewsgroups.com-b7.4zTQh5tI3A!not-for-mail Newsgroups: comp.lang.ada Subject: Re: Issue with GNAT GPL 2009 and GtkAda References: <4A414EBB.8060204@free.fr> <1avd65rn49abv$.krcxo2gdzb16$.dlg@40tude.net> From: Stephen Leake Date: Fri, 26 Jun 2009 05:02:27 -0400 Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (windows-nt) Cancel-Lock: sha1:RrWQSr+XerLElqgvY6fPITyKrjY= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@flashnewsgroups.com Organization: FlashNewsgroups.com X-Trace: 5f19f4a448e88e9cadf9d07678 Xref: g2news2.google.com comp.lang.ada:6630 Date: 2009-06-26T05:02:27-04:00 List-Id: "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. -- -- Stephe