comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@gnat.com (Robert Dewar)
Subject: Re: Constant elaboration order
Date: 1 Dec 2001 08:43:21 -0800
Date: 2001-12-01T16:43:21+00:00	[thread overview]
Message-ID: <5ee5b646.0112010843.6ad01bc3@posting.google.com> (raw)
In-Reply-To: gkWN7.44693$xS6.75190@www.newsranger.com

Ted Dennison<dennison@telepath.com> wrote in message news:<gkWN7.44693$xS6.75190@www.newsranger.com>...

> No. However, I know of no compiler that actually does 
> that.

This is misinformation. For a given compiler, you can be
certain that the order of elaboration will be consistent,
assuming that the order of compilation is consistent (for
source based systems that do not have a required order
of elaboration, the latter condition is likely irrelevant,
it certainly is irrelevant for GNAT).


> The DEC Ada compiler
> was capable of changing it from compile to compile. (It
> would optimize harder if
> it happened to have more resources available at compile 
> time).

I understand that this purports to be a counter example.
I believe this is misinformation as well.

Probably the confusion here is that of course in a traditional Ada 83
system, the elaboration order can
depend on the order of compilation, because of inlining,
but for a given order of compilation you will of course
get a consistent elaboration order.

However, big however! that order may well differ from
one compiler to another, or from one version of the same
compiler to another.

For information on elaboration, read the chapter on the
subject in the GNAT user's guide. I wrote that chapter, and
as far as I know it is the most comprehensive treatment
of the subject. It is of course tied into the way GNAT
does things, but even if you are not using GNAT, you can
learn a lot from this chapter.

Robert Dewar



  reply	other threads:[~2001-12-01 16:43 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 [this message]
2001-12-06 22:16     ` Thierry BERNIER
2001-12-06 22:33       ` Matthew Heaney
2001-12-07 14:34       ` Stephen Leake
replies disabled

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