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 10 of 12 Topic 5651 of 5831
Post > Topic >>

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

by Robert A Duff <bobduff@[EMAIL PROTECTED] > Apr 14, 2008 at 09:56 AM

"Peter C. Chapin" <pchapin@[EMAIL PROTECTED]
> writes:

> Thanks to you and Samuel Tardieu for your replies.

You're welcome.

>...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?

Yes.  Your original example (with no pragmas added) is legal, and a
valid Ada compiler (such as GNAT with -gnatE) will compile and link it
just fine.  However, it might fail at run time.  Worst case: it works
fine, but 2 years later, you ****t it to a new compiler (new machine, or
even a new version of the same compiler), and you get a mysterious
Program_Error.

If you get an elab cycle when you modify your program (e.g., you add a
with_clause), it's easy to deal with -- your change is small, and you
know it caused the cycle.  But if you get a Program_Error when ****ting a
giant program to a new compiler, it can easily take several hours to
figure out the problem.

- Bob
 




 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:44:22 CDT 2008.