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=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED.Oh2LSLzxQ4+YU0Htrufc+A.user.gioia.aioe.org!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Last chance handler on a PC Date: Fri, 31 Jan 2020 11:12:03 +0000 Organization: Aioe.org NNTP Server Message-ID: References: NNTP-Posting-Host: Oh2LSLzxQ4+YU0Htrufc+A.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Complaints-To: abuse@aioe.org User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (darwin) X-Notice: Filtered by postfilter v. 0.9.2 Cancel-Lock: sha1:UENXVxEnn0KPNuIofz34c70uAmU= Xref: reader01.eternal-september.org comp.lang.ada:57999 Date: 2020-01-31T11:12:03+00:00 List-Id: Niklas Holsti writes: > I had a similar elaboration problem some time ago in an embedded > application, where I wanted to set up some HW error-trap handlers that > I would like to be active also during elaboration, but I found no easy > way to ensure that the trap-handling package would be elaborated > before all other packages. Could you have used pragma Restrictions (No_Elaboration_Code); ? Or pragma No_Elaboration_Code_All -- This is a program unit pragma (there is also an equivalent aspect of the same name) that establishes the restriction No_Elaboration_Code for the current unit and any extended main source units (body and subunits). It also has the effect of enforcing a transitive application of this aspect, so that if any unit is implicitly or explicitly with’ed by the current unit, it must also have the No_Elaboration_Code_All aspect set. It may be applied to package or subprogram specs or their generic versions. (I've done this in Cortex GNAT RTS, so that I could write the startup code in Ada).