comp.lang.ada
 help / color / mirror / Atom feed
From: Damien Carbonne <damien.carbonne@free.fr>
Subject: "Limited with" usage
Date: Fri, 11 Nov 2005 12:24:30 +0100
Date: 2005-11-11T12:24:31+01:00	[thread overview]
Message-ID: <43747f6f$0$18304$636a15ce@news.free.fr> (raw)

Hi,

I am doing tests related to "limited with" using GNAT GPL2005 and GPS on 
a Linux box.

This very simple test fails:

----------------------------------------
limited with B;
package A is
end A;

with A;
package B is
end B;
----------------------------------------

with this message:
gnatmake -u -c -u -P/home/damien/dev/tests05/tests05.gpr a.ads -d
gcc -c -gnat05 -I- -gnatA /home/damien/dev/tests05/src/a.ads
a.ads:1:14: circular unit dependency
a.ads:1:14: "A (spec)" depends on "B (spec)"
a.ads:1:14: "B (spec)" depends on "A (spec)"
a.ads:1:14: "A (spec)" depends on "A (spec)"
gnatmake: "/home/damien/dev/tests05/src/a.ads" compilation error


If I replace "with A;" by "limited with A;" in package B, then it 
compiles fine.

Reading this paper 
(http://www.adacore.com/multimedia/pdfs/Ada05_rational_03.pdf, page 5):
-------------------------------------------------------------------------
It is important to understand that a limited with clause does not impose 
a dependence. Thus if a package A has a limited with clause for B, then 
A does not depend on B as it would with a normal with clause, and so B 
does not have to be compiled before A or placed into the library before A.
If we have a cycle of packages we only have to put limited with on one 
package since that is sufficient to break the cycle of dependences. 
However, for symmetry, in this example we have made them both have a 
limited view of each other.
-------------------------------------------------------------------------

I would think that there is a GNAT bug.
Am I right or did I miss something ?

Thanks for any answer.

Damien



             reply	other threads:[~2005-11-11 11:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-11 11:24 Damien Carbonne [this message]
2005-11-11 10:53 ` "Limited with" usage Georg Bauhaus
2005-11-11 12:15   ` Alex R. Mosteo
replies disabled

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