comp.lang.ada
 help / color / mirror / Atom feed
From: Stephen Leake <stephen.a.leake.1@gsfc.nasa.gov>
Subject: Re: Constant elaboration order
Date: 07 Dec 2001 09:34:18 -0500
Date: 2001-12-07T14:37:18+00:00	[thread overview]
Message-ID: <usnanumj9.fsf@gsfc.nasa.gov> (raw)
In-Reply-To: 3c0fedf4$0$203$626a54ce@news.free.fr

"Thierry BERNIER" <tajz@free.fr> writes:

> <snip>
> my question was about a given executable. When the compiler, binder and
> linker have processed source files. My executable is here and I would like
> to assert that from one run to another of this executable; elaboration code
> chunks are executed in the same order (the one statically choosen by the
> binder).

This is true. Any executable will give the same results when run
again, unless it depends on some random external factor (like time or
user input). Since there are no external factors determining
elaboration order, it is repeatable.

Hmm. I guess it is _possible_ to put external IO and tasks in
elaboration code, which _could_ affect the final elaboration order.
But you'd have to really work at it!

> I understand this is true for GNAT, but found no rule in the RM (we
> can forget annex E here).

Hmm. The closest rule I can find is 10.2.1 (26), which defines pragmas
Elaborate_Body and Elaborate_All. However, to really understand an
issue like this, you need to consider the RM as a whole, which can be
hard. That's why ACT made the effort of writing their user guide,
which is far more understandable (as you discovered).

In sum, elaboration order, in the absence of elaboration order
pragmas, is left to the implementation. If you want to guarrantee that
the elaboration order is safe, put in the elaboration pragmas
suggested by GNAT.

-- 
-- Stephe



      parent reply	other threads:[~2001-12-07 14:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-11-30 21:59 Constant elaboration order Thierry BERNIER
2001-12-01  1:25 ` Ted Dennison
2001-12-01 16:43   ` Robert Dewar
2001-12-06 22:16     ` Thierry BERNIER
2001-12-06 22:33       ` Matthew Heaney
2001-12-07 14:34       ` Stephen Leake [this message]
replies disabled

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