From: "Hibou57 (Yannick Duchêne)" <yannick_duchene@yahoo.fr>
Subject: Got warnings when overriding Initialize and Finalize
Date: Fri, 10 Jul 2009 07:16:47 -0700 (PDT)
Date: 2009-07-10T07:16:47-07:00 [thread overview]
Message-ID: <b10ebd28-794c-45aa-99ee-a56c51271d2f@d4g2000yqa.googlegroups.com> (raw)
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 “ warning: declaration of "Initialize"
hides one at line xxx ” where xxx is the line of “ type T is new
Ada.Finalization.Limited_Controlled with null record; ”. 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 :=
> (Ada.Finalization.Controlled with ...);
> ...
> end P;
So what to think about these warnings ?
Is there something I am not seeing ?
next reply other threads:[~2009-07-10 14:16 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-10 14:16 Hibou57 (Yannick Duchêne) [this message]
2009-07-10 15:34 ` Got warnings when overriding Initialize and Finalize Adam Beneschan
2009-07-10 16:12 ` Hibou57 (Yannick Duchêne)
2009-07-11 1:10 ` Randy Brukardt
2009-07-14 14:54 ` Robert A Duff
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox