"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


|