comp.lang.ada
 help / color / mirror / Atom feed
* GNAT GPL 2007 Problems with generics
@ 2007-05-15 14:14 Dmitry A. Kazakov
  2007-05-15 20:43 ` Dmitry A. Kazakov
  0 siblings, 1 reply; 2+ messages in thread
From: Dmitry A. Kazakov @ 2007-05-15 14:14 UTC (permalink / raw)


Hi there,

Does anybody know anything about the following problem. When a generic
package A instantiates another generic package B and refers to a subprogram
C from its body, then under certain circumstances (I cannot figure out
when), everything compiles, but then fails in gnatlink on "undefined
reference to xxxx" From the cryptic name xxxx, it seems that the module it
fails to find is the subprogram B.C (an instance in the instance of A)

The name xxxx has the pattern:

<name_of_instance_of_A>__<name_of_instance_of_B>__<name of C>__2X

P.S. I observed the effect on Windows 2003 Server

P.P.S. Does GNAT GPL 2007 share generic bodies?

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



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

* Re: GNAT GPL 2007 Problems with generics
  2007-05-15 14:14 GNAT GPL 2007 Problems with generics Dmitry A. Kazakov
@ 2007-05-15 20:43 ` Dmitry A. Kazakov
  0 siblings, 0 replies; 2+ messages in thread
From: Dmitry A. Kazakov @ 2007-05-15 20:43 UTC (permalink / raw)


On Tue, 15 May 2007 16:14:37 +0200, Dmitry A. Kazakov wrote:

> Does anybody know anything about the following problem. When a generic
> package A instantiates another generic package B and refers to a subprogram
> C from its body, then under certain circumstances (I cannot figure out
> when), everything compiles, but then fails in gnatlink on "undefined
> reference to xxxx" From the cryptic name xxxx, it seems that the module it
> fails to find is the subprogram B.C (an instance in the instance of A)
> 
> The name xxxx has the pattern:
> 
> <name_of_instance_of_A>__<name_of_instance_of_B>__<name of C>__2X

OK, I have figured out the problem. The bug is related to the visibility
rules. It appears when C refers to a parameter of the type T declared in
some fourth package D. In the specification of B it does this as C (...; X
: T;...). In the body it does it as C (...; X : D.T; ...).

The problem disappears when both become X : T. [ As far as I can remember,
they had to be different to work around another bug in some earlier version
of GNAT. ]
 
-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



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

end of thread, other threads:[~2007-05-15 20:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-05-15 14:14 GNAT GPL 2007 Problems with generics Dmitry A. Kazakov
2007-05-15 20:43 ` Dmitry A. Kazakov

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