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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,CP1252 Path: g2news2.google.com!postnews.google.com!d4g2000yqa.googlegroups.com!not-for-mail From: =?ISO-8859-1?Q?Hibou57_=28Yannick_Duch=EAne=29?= Newsgroups: comp.lang.ada Subject: Got warnings when overriding Initialize and Finalize Date: Fri, 10 Jul 2009 07:16:47 -0700 (PDT) Organization: http://groups.google.com Message-ID: NNTP-Posting-Host: 77.198.58.135 Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1247235408 22472 127.0.0.1 (10 Jul 2009 14:16:48 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 10 Jul 2009 14:16:48 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: d4g2000yqa.googlegroups.com; posting-host=77.198.58.135; posting-account=vrfdLAoAAAAauX_3XwyXEwXCWN3A1l8D User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; fr),gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:6939 Date: 2009-07-10T07:16:47-07:00 List-Id: Hello, I got some warnings which still stick to me when I want to override Initialize and Finalize on controlled types. Here is a reduced example of the matter : > with Ada.Finalization; > package Test is > type T is tagged limited private; > private > type T is new Ada.Finalization.Limited_Controlled with null record; > overriding procedure Initialize (Object : in out T); > overriding procedure Finalize (Object : in out T); > end Test; This give me warnings like =93 warning: declaration of "Initialize" hides one at line xxx =94 where xxx is the line of =93 type T is new Ada.Finalization.Limited_Controlled with null record; =94. The same warning appears for Finalize. If there is no more private part, there is no more warnings. Ex ... > with Ada.Finalization; > type T is new Ada.Finalization.Limited_Controlled with null record; > overriding procedure Initialize (Object : in out T); > overriding procedure Finalize (Object : in out T); > end Test; ... does not produce any warnings. If I do the following, there is no warning as well : > with Ada.Finalization; > package Test is > type T is new Ada.Finalization.Limited_Controlled with private; > overriding procedure Initialize (Object : in out T); > overriding procedure Finalize (Object : in out T); > private > type T is new Ada.Finalization.Limited_Controlled with null record; > end Test; Is it mandatory to declare overriding of Initialize and Finalize in the public part and thus to declare the T is an Ada.Finalization.Limited_Controlled in the public part as well ? But the Annotated RM contains this small excerpt : AARM 7.6 17.h.2/1 says: > package P is > type Dyn_String is private; > Null_String : constant Dyn_String; > ... > private > type Dyn_String is new Ada.Finalization.Controlled with ... > procedure Finalize(X : in out Dyn_String); > procedure Adjust(X : in out Dyn_String); > > Null_String : constant Dyn_String :=3D > (Ada.Finalization.Controlled with ...); > ... > end P; So what to think about these warnings ? Is there something I am not seeing ?