comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@gnat.com (Robert Dewar)
Subject: Re: Elaboration in GNAT
Date: 4 Jan 2002 16:50:37 -0800
Date: 2002-01-05T00:50:37+00:00	[thread overview]
Message-ID: <5ee5b646.0201041650.208d0918@posting.google.com> (raw)
In-Reply-To: u3bh1tiuppk9c7@corp.supernews.com

Some things to remember here:

1. The static elaboration model of GNAT is primarily intended for the
development of new code.

2. If you are using GNAT in static mode, and do not intend
to port the code to other compilers, it is a waste of time
to mess around adding pragma Elaborate_All's, as was
correctly noted in this thread, the -gnatwl warning is
useful ONLY if you want to make sure that your code remains
portable to other compilers without worrying about elaboration order
messing things up.

3. If you are working with legacy code, it often makes no
sense to try to use the static model of GNAT, and you should simply
use -gnatE, and use the RM dynamic elaboration model. I am always
surprised by people who
are absolutely determined to beat legacy code into submission to the
GNAT static model. Yes, of course this
makes life easier in the future, but you have to be sure
it is worth the work.

4. If you are working with legacy code, which has complex
elaboration requirements, it is *highly* likely that the'
code has serious bugs in it -- namely it does not have all
the pragma Elaborate statements that should be there.

5. If you have buggy code of this kind, then you are between a rock
and a hard place.

rock = work required to meet GNAT static model
hard place = work required to stick in all the pragmas

It can often be very difficult to decide which way to go

But always remember that the GNAT static model is an
optional additional facility. It can never make porting
harder, because you can always proceed as though it is
not there.

The reason it is the default is so that those lucky Ada
programmers who know nothing about the horrors of elaboration who are
writing new code will find it impossible to dig themselves into
elaboration hell
unawares :-)

Robert Dewar



  parent reply	other threads:[~2002-01-05  0:50 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 [this message]
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
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