comp.lang.ada
 help / color / mirror / Atom feed
* "Limited with" usage
@ 2005-11-11 11:24 Damien Carbonne
  2005-11-11 10:53 ` Georg Bauhaus
  0 siblings, 1 reply; 3+ messages in thread
From: Damien Carbonne @ 2005-11-11 11:24 UTC (permalink / 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



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-11-11 12:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-11-11 11:24 "Limited with" usage Damien Carbonne
2005-11-11 10:53 ` Georg Bauhaus
2005-11-11 12:15   ` Alex R. Mosteo

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