From: Simon Wright <simon@pushface.org>
Subject: Re: Warnings about hiding
Date: Fri, 08 Oct 2010 21:24:19 +0100
Date: 2010-10-08T21:24:19+01:00 [thread overview]
Message-ID: <m239sgjuvg.fsf@pushface.org> (raw)
In-Reply-To: 86ad4138-6b93-4b1d-a3ba-6ffed2d9d5c0@t5g2000prd.googlegroups.com
Adam Beneschan <adam@irvine.com> writes:
> On Oct 8, 5:47 am, Julian Leyh <jul...@vgai.de> wrote:
>> Hi,
>>
>> "-gnatwh" activates warnings on hiding declarations. But sometimes,
>> hiding is necessary.
>>
>> For example, consider this (Controlled type with it's own comparison
>> operator and finalize procedure, you can reproduce the errors using
>> these ads files):
>>
>> $ cat foo.ads
>> with Ada.Finalization;
>> package foo is
>> type Foobar is new Ada.Finalization.Controlled with null record;
>> function "=" (L,R : in Foobar) return Boolean;
>> private
>> procedure Finalize (Object : in out Foobar);
>> end foo;
>> $ gnat -gnatwh -gnatc foo.ads
>> gcc -c -gnatwh -gnatc foo.ads
>> foo.ads:4:13: warning: declaration of "=" hides one in package
>> Standard
>> foo.ads:6:14: warning: declaration of "Finalize" hides one at line 3
>> $
>
> Well, I was going to suggest using the "overriding" keyword (not a bad
> idea anyway), but when I tried it, GNAT still displayed the warnings.
> Now *that* looks like a bug. (I'm using 4.3.3; maybe it's been fixed
> in a later version)
Still there in GCC 4.5.0 & GNAT GPL 2010.
next prev parent reply other threads:[~2010-10-08 20:24 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-08 12:47 Warnings about hiding Julian Leyh
2010-10-08 19:46 ` Adam Beneschan
2010-10-08 20:24 ` Simon Wright [this message]
2010-10-09 1:31 ` Vinzent Hoefler
2010-10-09 6:51 ` Randy Brukardt
2010-10-09 8:08 ` Dmitry A. Kazakov
2010-10-26 1:34 ` Yannick Duchêne (Hibou57)
2010-10-26 1:28 ` Yannick Duchêne (Hibou57)
2010-10-09 11:18 ` anon
2010-10-09 19:11 ` Simon Wright
2010-10-09 20:11 ` anon
2010-10-26 1:16 ` Yannick Duchêne (Hibou57)
2010-10-26 9:32 ` J-P. Rosen
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox