comp.lang.ada
 help / color / mirror / Atom feed
From: Robert A Duff <bobduff@shell01.TheWorld.com>
Subject: Re: Elaboration worries
Date: 21 Jun 2006 19:07:11 -0400
Date: 2006-06-21T19:07:11-04:00	[thread overview]
Message-ID: <wccodwmumzk.fsf@shell01.TheWorld.com> (raw)
In-Reply-To: 4fssh9F1ena5jU1@individual.net

"Alex R. Mosteo" <devnull@mailinator.com> writes:

> a) make your package Pure.
> b) if not possible, make it Preelaborate.
> c) if not possible, put an Elaborate_Body in the spec.
> 
> I was happy following this rule, but just recently I've started to
> experiment with the -gnatwl switch, that warns when a "Elaborate_All" is
> needed. I have two questions related with this. 
> 
> The first one is that I don't really grasp why a "Elaborate_All" could be
> needed if one strictly follows the tree rules above.

I don't think you can follow those three rules in all cases,
because they place restrictions on the code you can write.
For example, Elab_Body prevents a package body from with-ing
its children.

There's a good description of elab issues in the GNAT docs.

> The second one is this: by my observation of the gnat warnings, it seems
> that the requirement for "Elaborate_All" is a "server side" one. However, I
> must use the E_A in all "client side" units. This is because contrarily to
> the abc) rule pragmas, that can refer to the package where they appear, E_A
> can not.

Yes, that is a pain.

> Example: Package A causes a warning for E_A in all packages that use
> A.


No -- only if they use A at elaboration time.

>... I
> can't do nothing at A to remove the warning, but to put an E_A(A) in all
> client packages. This seems strange to me.

Yes, it is strange.

> A final note is that this second situation happens to me mostly with generic
> units.

Yes, that's because generic instantiations are usually at library level,
and are therefore elaborated at library package elab time.

- Bob



  parent reply	other threads:[~2006-06-21 23:07 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-21 12:33 Elaboration worries Alex R. Mosteo
2006-06-21 18:01 ` Samuel Tardieu
2006-06-21 20:34 ` Randy Brukardt
2006-06-21 23:07   ` Samuel Tardieu
2006-06-22 23:06     ` Randy Brukardt
2006-06-23 18:42       ` Samuel Tardieu
2006-06-23 19:54         ` Randy Brukardt
2006-06-21 23:12   ` Robert A Duff
2006-06-22 23:09     ` Randy Brukardt
2006-06-21 23:07 ` Robert A Duff [this message]
2006-06-22  2:24   ` Matthew Heaney
2006-06-22 10:36 ` Alex R. Mosteo
2006-06-22 16:25   ` Alex R. Mosteo
2006-06-22 23:31   ` Randy Brukardt
replies disabled

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