comp.lang.ada
 help / color / mirror / Atom feed
From: stt@inmet
Subject: Re: Novice Questions on Ada Exceptions
Date: 23 Aug 89 12:53:00 GMT	[thread overview]
Message-ID: <20600004@inmet> (raw)
In-Reply-To: 620@thor.wright.EDU


One frequent cause of PROGRAM_ERROR is an elaboration-order
problem.  Whenever a subprogram is called before it has
been elaborated, PROGRAM_ERROR is raised.  This happens
most frequently when elaboration-time code
in one package calls subprograms in another package,
and the other package's body has not yet been elaborated.
This is something which sometimes shows up in
rehosting since elaboration-order determination is 
implementation-dependent.  

The usual fix is to
determine which package calls which other package at
elaboration time, and place a pragma Elaborate (see LRM 10.5:3)
in the calling package referencing the called package.
Note that if the called package calls other packages, there
may be a need to include additional pragma Elaborates on
those lower level packages.  Pragma Elaborate only forces
elaboration for a single level of dependency.  Hopefully,
Ada 9X will fix it so that it forces elaboration for
the closure of dependencies...

S. Tucker Taft
Intermetrics, Inc.
Cambridge, MA  02138

  reply	other threads:[~1989-08-23 12:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1989-08-21  1:22 Novice Questions on Ada Exceptions Tom McClory
1989-08-23 12:53 ` stt [this message]
1989-08-30 10:00   ` Pragma ELABORATE (was: Re: Novice Questions on Ada Exceptions) adh
replies disabled

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