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-Language: ENGLISH,ASCII X-Google-Thread: 103376,3a414836333dfef7 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-11-29 07:08:08 PST Path: archiver1.google.com!news2.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!hammer.uoregon.edu!skates!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada Subject: Re: Elaboration in GNAT Date: 29 Nov 2001 08:17:41 -0500 Organization: NASA Goddard Space Flight Center Message-ID: References: <1006952193.650930@edh3> NNTP-Posting-Host: anarres.gsfc.nasa.gov Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: skates.gsfc.nasa.gov 1007040003 3646 128.183.220.71 (29 Nov 2001 13:20:03 GMT) X-Complaints-To: dscoggin@cne-odin.gsfc.nasa.gov NNTP-Posting-Date: 29 Nov 2001 13:20:03 GMT User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7 Xref: archiver1.google.com comp.lang.ada:17163 Date: 2001-11-29T13:20:03+00:00 List-Id: Frode Tenneboe writes: > Using -gnatwa I get some elaboration issues with some legacy code in GNAT. > One of these are: > > foo.adb:69:04: warning: instantiation of "Client" may raise Program_Error > foo.adb:69:04: warning: missing pragma Elaborate_All for "bar" Can you edit the code? In that case, just add "pragma Elaborate_All (bar);" in the context clause of foo.adb. Or, if you are using my Emacs Ada mode extension gnat-fix-error.el, just hit C-f6, and this is done for you :). Hmm, apparently "Client" is a generic. In that case, it may be you need the Elaborate_All in client.ads or client.adb; I'd have to see the code, and re-read the manual, to be sure. > The problem is that this crops up everywhere which I asume is > because the elboration of package bar is not very healthy. I'm not clear what you mean by "healthy". The precise meaning of this error message is something like: "Some compilers may choose an elaboration order that will elaborate 'foo' before 'bar'. In that case, elaborating 'foo' will raise Program_Error". The default mode of GNAT is to pick an elaboration order that avoids this problem. The warning here is to help with porting to other compilers. > The package in question uses Ada.Calendar, however there must be > some code in one (or more) of the dependencies in the body of bar > which causes this. A manual inspection of this code is not done over > night. I'm not clear why you think Ada.Calendar is relevant; it is not mentioned in the error message (unless that's what 'foo' or 'bar' really is). > Is there a way of getting the information above a bit more verbose? You need to read the chapters in the GNAT manual about elaboration; I think you are confused (not surprising; elaboration can be confusing!). Feel free to post a (small) example that gives this error. > > > -Frode -- ^ Frode Tenneb� | email: ft@edh.ericsson.se ^ | Ericsson > Radar AS. N-1788 Halden | | | Phone: +47 69 21 41 47 | Frode@IRC | | > with Standard.Disclaimer; use Standard.Disclaimer; | -- -- Stephe