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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,ebfd1d7c60facfc5 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!news.glorb.com!border1.nntp.dca.giganews.com!nntp.giganews.com!peer01.cox.net!cox.net!peer-uk.news.demon.net!kibo.news.demon.net!news.demon.co.uk!demon!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: elaboration circularity detected problem, How to fix? Date: 22 Sep 2004 22:08:33 +0100 Organization: Pushface Sender: simon@smaug.pushface.org Message-ID: References: <414eee7d@dnews.tpgi.com.au> NNTP-Posting-Host: pogner.demon.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: news.demon.co.uk 1095887673 4419 62.49.19.209 (22 Sep 2004 21:14:33 GMT) X-Complaints-To: abuse@demon.net NNTP-Posting-Date: Wed, 22 Sep 2004 21:14:33 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 Xref: g2news1.google.com comp.lang.ada:3963 Date: 2004-09-22T22:08:33+01:00 List-Id: "Scott Travak" 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.