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:19:49 +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) Cancel-Lock: sha1:wCMKT71MeJEJ6FFpxHy9pDSKRr8= X-Notice: Filtered by postfilter v. 0.9.2 Xref: reader01.eternal-september.org comp.lang.ada:58000 Date: 2020-01-31T11:19:49+00:00 List-Id: Simon Wright writes: > 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). Sorry, that was stupid: you needed the package to have elaboration code so that it could set up the error-trap handlers!