Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Ada > Re: Question ab...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 9 of 12 Topic 5651 of 5831
Post > Topic >>

Re: Question about circular elaboration order error (GNAT).

by "Peter C. Chapin" <pchapin@[EMAIL PROTECTED] > Apr 13, 2008 at 06:49 PM

Robert A Duff wrote:

> The stricter rules are conservative, and modular -- when compiling
> Parent, it sees that you're calling Parent.Child, and assumes the worst
> WITHOUT looking at Parent.Child body.  For example, it assumes that
> Parent.Child might call Dummy, causing a real cycle.

Thanks to you and Samuel Tardieu for your replies. They do help to 
clarify things for me somewhat. It is easy for me to understand how 
Parent.Child's body would have an elaboration dependency on Parent's 
spec, but I did not expect Parent.Child's body to necessarily have an 
elaboration dependency on Parent's body. Are you saying that it doesn't 
(necessarily) have such a dependency in standard Ada, but that I'm 
experiencing an example of GNAT's stricter rules?

In any event I got my example to work with an appropriate application of 
pragma Elaborate. I guess I didn't stumble into the right combination in 
my earlier tinkering. It helps to have a better idea of what is 
happening. :-)

> I suggest you read the section in the GNAT docs about elaboration.
> It explains all this stuff in great detail.

Yes, actually I read that stuff, but I didn't see anything in particular 
about elaboration dependencies between parent and child packages.

>> Note my actual program involves a task in the parent that is trying to
>> use subprograms in the child. However, the difficulties I'm having
>> appear to be unrelated to tasking.
> 
> Don't be too sure.  Tasks get activated "early", and can easily cause
> elab cycles.  Look at the docs for details.

I'm not saying that the errors in the tasking example (my real program) 
are wrong. Indeed, I assumed there was some non-trivial stuff going on 
during elaboration that was stimulating the error. I was just glad when 
I could (apparently) reproduce the problem with a simpler example. That 
makes it easier to study, of course.

Peter
 




 12 Posts in Topic:
Question about circular elaboration order error (GNAT).
"Peter C. Chapin&quo  2008-04-13 14:12:34 
Re: Question about circular elaboration order error (GNAT).
Samuel Tardieu <sam@[E  2008-04-13 21:43:19 
Re: Question about circular elaboration order error (GNAT).
Robert A Duff <bobduff  2008-04-13 16:20:30 
Re: Question about circular elaboration order error (GNAT).
Samuel Tardieu <sam@[E  2008-04-13 23:20:42 
Re: Question about circular elaboration order error (GNAT).
Robert A Duff <bobduff  2008-04-14 16:21:54 
Re: Question about circular elaboration order error (GNAT).
Adam Beneschan <adam@[  2008-04-14 16:36:41 
Re: Question about circular elaboration order error (GNAT).
Georg Bauhaus <rm.tsoh  2008-04-15 09:13:38 
Re: Question about circular elaboration order error (GNAT).
Robert A Duff <bobduff  2008-04-13 15:46:29 
Re: Question about circular elaboration order error (GNAT).
"Peter C. Chapin&quo  2008-04-13 18:49:25 
Re: Question about circular elaboration order error (GNAT).
Robert A Duff <bobduff  2008-04-14 09:56:03 
Re: Question about circular elaboration order error (GNAT).
"Jeffrey R. Carter&q  2008-04-14 17:33:33 
Re: Question about circular elaboration order error (GNAT).
Robert A Duff <bobduff  2008-04-14 13:52:59 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Jul 25 20:49:17 CDT 2008.