From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,f63c22a739f1e4e5 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!news4.google.com!newsfeed2.dallas1.level3.net!news.level3.com!newsfeed-00.mathworks.com!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: How did dynamic elaboration fix cyclic elaboration error??? Date: 06 Apr 2006 19:45:06 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <1144364373.517170.92020@z34g2000cwc.googlegroups.com> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls4.std.com 1144367107 16873 192.74.137.71 (6 Apr 2006 23:45:07 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Thu, 6 Apr 2006 23:45:07 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: g2news1.google.com comp.lang.ada:3740 Date: 2006-04-06T19:45:06-04:00 List-Id: "stuart clark" 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