comp.lang.ada
 help / color / mirror / Atom feed
From: Stephen Leake <Stephe.Leake@nasa.gov>
Subject: Re: circular unit dependency
Date: 23 May 2003 14:08:42 -0400
Date: 2003-05-23T18:24:29+00:00	[thread overview]
Message-ID: <ud6i95ydx.fsf@nasa.gov> (raw)
In-Reply-To: 3ECDE7D1.9010507@alcatel.de

Mirko Aigner <Mirko.Aigner@alcatel.de> writes:

> Hi Again !!
> 
> Any way to prevent this compiler error (circular unit dependency)
> without deleting one of the "with" statements ?!

You will have to change something. You'll have to post the code, so we
can help you figure out what to change. Try to simplify it first.

If you have something like:

with A;
package B is
  
   type B_Type is record
      A_Obj : A.A_Type;
   end record;
end B;

with B;
package A is
  
   type A_Type is record
      B_Obj : B.B_Type;
   end record;
end A;

then the only way to "fix" this is to put both types in one package.
They belong together, since they are dependent on each other.

Other types of circular with can be cured by introducing a "parent" type.

> Is there any way to make sure that on spec is only once "included"
> ?!

"with" in Ada is really, really _not_ the same as "include" in C. By
definition, each package is in the library only once.

-- 
-- Stephe



  parent reply	other threads:[~2003-05-23 18:08 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-23  9:20 circular unit dependency Mirko Aigner
2003-05-23 11:37 ` Jeffrey Creem
2003-05-23 12:12   ` David C. Hoos
2003-05-23 18:08 ` Stephen Leake [this message]
2003-05-24 22:12   ` Robert I. Eachus
2003-05-26  8:05   ` Mirko Aigner
  -- strict thread matches above, loose matches on Subject: below --
2005-01-04 18:31 R
2005-01-04 23:45 ` Randy Brukardt
2005-01-05  8:35   ` Martin Krischik
2005-01-05  8:55     ` Duncan Sands
2005-01-05  0:26 ` Stephen Leake
1998-05-26  0:00 Brendan Reville
1997-05-24  0:00 jdlopez
1997-05-24  0:00 ` Michael F Brenner
1997-05-25  0:00 ` Jon S Anthony
1997-05-26  0:00   ` John G. Volan
1997-05-26  0:00     ` Fergus Henderson
1997-05-27  0:00     ` Jon S Anthony
1997-05-28  0:00 ` John G. Volan
1997-06-01  0:00   ` John G. Volan
1997-05-31  0:00 ` Kevin Cline
1997-05-31  0:00   ` Matthew Heaney
     [not found]     ` <33932F31.4399@sprintmail.com>
1997-06-02  0:00       ` Matthew Heaney
1997-06-03  0:00         ` John G. Volan
1997-06-05  0:00           ` Matthew Heaney
1997-06-05  0:00             ` John G. Volan
1997-06-06  0:00             ` Stephen Schmid
1997-06-03  0:00         ` W. Wesley Groleau (Wes)
1997-06-03  0:00           ` John G. Volan
1997-05-31  0:00   ` John G. Volan
1997-06-01  0:00     ` Kevin Cline
1997-06-01  0:00       ` John G. Volan
1997-06-02  0:00     ` John G. Volan
replies disabled

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