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!reader02.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: How to tell whether program finalization can be suppressed Date: Fri, 01 Dec 2017 21:39:21 +0000 Organization: A noiseless patient Spider Message-ID: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: reader02.eternal-september.org; posting-host="f39fb05531879655f2e70fab36b87cc2"; logging-data="12857"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18r3i15tm2j9+2x6cZjD5rTVg/mxl707MY=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (darwin) Cancel-Lock: sha1:L+yXgDyZKzEnjHIylJ2lPydMVi0= sha1:DAEQzPuM0o4zFTLboGQiLKJi8es= Xref: reader02.eternal-september.org comp.lang.ada:49313 Date: 2017-12-01T21:39:21+00:00 List-Id: In Cortex GNAT RTS[1] (a Ravenscar RTS), I've wanted to support finalization (at present, I have the possibly GNAT-specific restriction No_Finalization). Unfortunately, as reported in PR66205[2], without No_Finalization and in the presence of other RTS-limiting features, gnatbind generates binding code which won't compile. I need to find a way of determining whether the RTS actually needs program-level finalization (that is, finalization called on program exit), because that's where the bad code is generated. Clearly, if the program never exits, there will be no need for program-level finalization. Amongst other things, I can test for specific restrictions, and I'm wondering whether No_Task_Termination would be appropriate for this? (I'm assuming that the environment task mustn't terminate, even if the main program exits; and in this RTS, exceptions can't be propagated). [1] https://github.com/simonjwright/cortex-gnat-rts [2] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66205