comp.lang.ada
 help / color / mirror / Atom feed
From: Warren <ve3wwg@gmail.com>
Subject: Re: Overload of functions in a task stack
Date: Mon, 10 May 2010 17:30:14 +0000 (UTC)
Date: 2010-05-10T17:30:14+00:00	[thread overview]
Message-ID: <Xns9D74895F14C66WarrensBlatherings@188.40.43.245> (raw)
In-Reply-To: a4179dee-f23c-489b-9695-166460597b1b@u30g2000prd.googlegroups.com

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1316 bytes --]

Anh Vo expounded in news:a4179dee-f23c-489b-9695-
166460597b1b@u30g2000prd.googlegroups.com:

> On May 3, 10:57�am, Pablo <pablit...@gmail.com> wrote:
>> Hi,
>> I have a function called Answer defined in several packages (each one
>> is different according to the own package), and each function Answer
>> is called by a permanent task every cycle. The issue is that when I
>> compile some packages, the compiler bugs me informing "warning:
>> declaration of "Answer" hides one at (...)". So, is there a way to
>> define these overload functions in a "secure" way that I do not need
>> to use pragma Warnings (OFF) to avoid these warnings?
>> Thanks
> 
> I believe use Clause of more than one package containing function
> Answer is involved. The simple fix is to replace use Clause with full
> qualification.
> 
> Anh Vo

As a compromise, you can do as I often do. Restrict
your use clause usage to certain declare blocks. But this
still won't work if two or more packages are simultaneously
"used" containing "Answer". But I find this technique
useful for use clausing in a more controlled manner.

procedure Beat_Me_Use_Me is
   ...
begin
    ...
    declare
        use P1;

        T1 : P1_Type;  -- from P1        
    begin
        Answer(T1);    -- P1.Answer
    end;
    ...
end Beat_Me_Use_Me;

Warren



      reply	other threads:[~2010-05-10 17:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-03 17:57 Overload of functions in a task stack Pablo
2010-05-03 23:53 ` Anh Vo
2010-05-10 17:30   ` Warren [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox