comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Wright <simon@pushface.org>
Subject: Re: elaboration circularity detected problem, How to fix?
Date: 22 Sep 2004 22:08:33 +0100
Date: 2004-09-22T22:08:33+01:00	[thread overview]
Message-ID: <x7vacvinh9q.fsf@smaug.pushface.org> (raw)
In-Reply-To: 414eee7d@dnews.tpgi.com.au

"Scott Travak" <s.travak@j-inet.com> writes:

> Hi everyone, I was hoping to obtain some assistance with a program I am 
> constructing. Essentially my program is made up as follows:
> 
> 1) Two packages (one of which is a generic package).
> 2) Each package essentially contains a task
> 3) Each task contains a reference to (operates on) the other task
> 
> I am encountering a "elaboration circularity detected" error (see
> below).

The thing to do is to avoid having library level tasks.

The tasks start up as they are elaborated and, since they reference
each other, the compiler can't tell that there isn't a problem (even
if you use the

  task body ...
  begin
     accept Start;

idiom to stop things happening until you are ready).

One way round this is to use access-to-task-type's and only actually
allocate the tasks when you are ready.


Of course there are other ways of getting a circularity (our record
was a loop of 534 in a program with only 530 packages!! I think there
may have been a bug somewhere .. but that was GNAT 3.11 or
thereabouts), but the task way is a winner.


-- 
Simon Wright                               100% Ada, no bugs.



      parent reply	other threads:[~2004-09-22 21:08 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-20 14:51 elaboration circularity detected problem, How to fix? Scott Travak
2004-09-20 15:52 ` Martin Dowie
2004-09-20 17:11   ` Florian Weimer
2004-09-20 21:19     ` Randy Brukardt
2004-09-21 10:09       ` Martin Dowie
2004-09-21 17:53         ` Randy Brukardt
2004-09-21  6:32   ` Scott Travak
2004-09-21  7:30     ` gnat options (Re: " Peter Hermann
2004-09-21  8:00       ` Scott Travak
2004-09-21  8:09       ` Alex R. Mosteo
     [not found] ` <7e7vk0dv2qhpqbdd58c0bvpesitapijr8v@4ax.com>
2004-09-21  6:44   ` Scott Travak
2004-09-21 18:40     ` Ludovic Brenta
2004-09-21 20:15       ` Scott Travak
2004-09-22 21:08 ` Simon Wright [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