comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: GNAT GPL 2007 Problems with generics
Date: Tue, 15 May 2007 22:43:33 +0200
Date: 2007-05-15T22:43:12+02:00	[thread overview]
Message-ID: <v6bw5ol9ahi3$.7kw2rmunw18x.dlg@40tude.net> (raw)
In-Reply-To: 14839k5x0otsk.mv0vz7fjh95y$.dlg@40tude.net

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



      reply	other threads:[~2007-05-15 20:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-15 14:14 GNAT GPL 2007 Problems with generics Dmitry A. Kazakov
2007-05-15 20:43 ` Dmitry A. Kazakov [this message]
replies disabled

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