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-7-bit X-Google-Thread: 103376,3a414836333dfef7 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-11-28 10:13:11 PST Path: archiver1.google.com!news2.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!cpk-news-hub1.bbnplanet.com!cambridge1-snf1.gtei.net!news.gtei.net!bos-service1.ext.raytheon.com!dfw-service2.ext.raytheon.com.POSTED!not-for-mail Message-ID: <3C052930.4FE65C5D@Raytheon.com> From: Mark Johnson X-Mailer: Mozilla 4.5 [en] (WinNT; I) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Elaboration in GNAT References: <1006952193.650930@edh3> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Wed, 28 Nov 2001 12:13:04 -0600 NNTP-Posting-Host: 192.27.48.44 X-Complaints-To: news@ext.ray.com X-Trace: dfw-service2.ext.raytheon.com 1006971190 192.27.48.44 (Wed, 28 Nov 2001 12:13:10 CST) NNTP-Posting-Date: Wed, 28 Nov 2001 12:13:10 CST Organization: Raytheon Company Xref: archiver1.google.com comp.lang.ada:17119 Date: 2001-11-28T12:13:04-06:00 List-Id: Frode Tenneboe wrote: > 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" > > The problem is that this crops up everywhere which I asume is because > the elboration of package bar is not very healthy. > > 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. > > Is there a way of getting the information above a bit more verbose? Not that I am aware of. I had some lengthy discussions with Robert Dewar about this particular issue. The warning basically says that elaboration code in the current package depends upon another package. To be safe - elaborate the other package (and all packages it depends upon) prior to elaboration of the current package. I agree with the reasoning behind this so I have this warning turned on all compiles we do as well. Since I also demand warning free software in our facility, my "solution" is to add pragma Elaborate_All(bar); in every place the warning is issued. That way if we have any mutual dependencies [we haven't] they become compiler errors. This is a quick solution and doesn't require any extensive analysis to put into place. Robert of course may give you slightly different suggestions. One that I tend to ignore is to not use "gnatwa", but to specify exactly which warnings you want and don't want. I have found over the last several months that added warnings from gnatwa are beneficial and I'm sticking with it. --Mark