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,f93e461e8491e322 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!news.maxwell.syr.edu!panix!newsfeed-00.mathworks.com!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Limited_Controlled, orthogonality and related issues Date: Thu, 18 Jan 2007 11:25:44 -0500 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <87zm8g4k9k.fsf@ludovic-brenta.org> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls6.std.com 1169137544 9198 192.74.137.71 (18 Jan 2007 16:25:44 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Thu, 18 Jan 2007 16:25:44 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:oy1GE3KgVTHkUnOEamePHtE8w7M= Xref: g2news2.google.com comp.lang.ada:8263 Date: 2007-01-18T11:25:44-05:00 List-Id: Ludovic Brenta writes: > type T_Finalizer (Enclosing : access T) is > new Ada.Finalization.Limited_Controlled with null record; > > procedure Finalize (Finalizer : in out T); > but the program compiled with GNAT does not display the two > finalization messages. Bug (i.e. the finalization procedures should > be called as per ARM 7.6.1(9)) or feature (i.e. GNAT optimizes the > calls away, noticing that the program is terminating anyway)? Bug -- in your program. ;-) You meant T_Finalizer instead of T in procedure Finalize. This is an easy mistake to make. As somebody pointed out, in Ada 2005, you can use the overriding keyword to prevent that problem. - Bob