From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 Path: utzoo!attcan!uunet!cs.utexas.edu!usc!bbn!ishmael!inmet!stt From: stt@inmet Newsgroups: comp.lang.ada Subject: Re: Novice Questions on Ada Exceptions Message-ID: <20600004@inmet> Date: 23 Aug 89 12:53:00 GMT References: <620@thor.wright.EDU> Nf-ID: #R:thor.wright.EDU:-62000:inmet:20600004:000:1018 Nf-From: inmet!stt Aug 23 08:53:00 1989 List-Id: 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