comp.lang.ada
 help / color / mirror / Atom feed
From: Stephen Leake <stephen.a.leake.1@gsfc.nasa.gov>
Subject: Re: Elaboration in GNAT
Date: 29 Nov 2001 08:13:21 -0500
Date: 2001-11-29T13:15:42+00:00	[thread overview]
Message-ID: <ur8qhhg9a.fsf@gsfc.nasa.gov> (raw)
In-Reply-To: 1006952193.650930@edh3

Frode Tenneboe <ft@alne.edh.ericsson.se> 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



  parent reply	other threads:[~2001-11-29 13:13 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-11-28 12:34 Elaboration in GNAT Frode Tenneboe
2001-11-28 18:13 ` Mark Johnson
2001-11-29  3:44   ` Robert Dewar
2001-11-29 13:30     ` Stephen Leake
2001-11-28 19:25 ` Robert Dewar
2002-01-04 13:21   ` Frode Tenneboe
2002-01-04 15:07     ` Matthew Heaney
2002-01-05  0:43       ` Robert Dewar
2002-01-05  0:50       ` Robert Dewar
2002-01-07 17:22         ` Mark Johnson
2002-01-08  0:00           ` Robert Dewar
2002-01-10 21:54         ` Robert A Duff
2002-01-11  4:49           ` Robert Dewar
2002-01-11 13:35             ` Robert A Duff
2002-01-11 19:18               ` Robert Dewar
2002-01-16 11:48           ` Arnaud Charlet
2002-01-05  0:40     ` Robert Dewar
2002-01-07 13:28       ` Frode Tenneboe
2002-01-11 19:25         ` Robert Dewar
2001-11-29 13:13 ` Stephen Leake [this message]
2001-11-29 13:17 ` Stephen Leake
2001-11-30 12:44   ` 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