comp.lang.ada
 help / color / mirror / Atom feed
From: Robert A Duff <bobduff@shell01.TheWorld.com>
Subject: Re: How did dynamic elaboration fix cyclic elaboration error???
Date: 06 Apr 2006 19:45:06 -0400
Date: 2006-04-06T19:45:06-04:00	[thread overview]
Message-ID: <wcck6a2b75p.fsf@shell01.TheWorld.com> (raw)
In-Reply-To: 1144364373.517170.92020@z34g2000cwc.googlegroups.com

"stuart clark" <stuartlclark@hotmail.com> writes:

> We are using Gnat Pro here at work and one of the guys i'm working with
> suggested turning on dynamic_elaboration in the UATL library, ie the
> ada compile gnat switch -gnatE. Note I also took out the pragma
> elaborates described above.
> 
> This worked !!! the bind error disappeared.
> 
> DOES ANYONE KNOW WHY???

If you're using GNAT Pro, I guess you have a support contract with
AdaCore, and you can ask AdaCore.

Elaboration order problems (including cycles) can be very confusing and
frustrating.  You should read the section "Elaboration Order Handling in
GNAT" in the GNAT User's Guide.

By default, GNAT uses a static method, which being static, is of course
conservative.  The static method does not conform to the Ada standard --
some legal Ada programs will be rejected.  The -gnatE switch causes GNAT
to conform the Ada standard, which requires run-time checks.  This means
that the bind error will disappear, and you might or might not get
run-time errors during elaboration.

It is best to avoid -gnatE, if possible.

With -gnatE, if you get no run-time errors during elaboration, you're
OK for now (assuming you don't do anything weird during library-level
elaboration, such as conditional code based on input data).  But you
code might not be portable to a different compiler (such as a newer
version of GNAT that happens to choose a different order).

- Bob



  reply	other threads:[~2006-04-06 23:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-06 22:59 How did dynamic elaboration fix cyclic elaboration error??? stuart clark
2006-04-06 23:45 ` Robert A Duff [this message]
2006-04-07  6:02 ` Simon Wright
replies disabled

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