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!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: "J-P. Rosen" Newsgroups: comp.lang.ada Subject: Re: Accessibility Levels and Library-Level Units Date: Tue, 24 Sep 2013 22:02:39 +0200 Organization: A noiseless patient Spider Message-ID: References: <58149dd9-990d-415c-a121-bc7a1a69473c@googlegroups.com> <5f5b3a27-574d-462e-ae09-dcc6ed3fd861@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Injection-Date: Tue, 24 Sep 2013 20:02:39 +0000 (UTC) Injection-Info: mx05.eternal-september.org; posting-host="2b3884a634d8f846e0712b4e3a92507a"; logging-data="472"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+PKnsV6ohhYStphLnLioMI" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 In-Reply-To: <5f5b3a27-574d-462e-ae09-dcc6ed3fd861@googlegroups.com> Cancel-Lock: sha1:qrcJGE5WjZJLZd+Pvf5VEpWEeiY= X-Enigmail-Version: 1.5.2 Xref: news.eternal-september.org comp.lang.ada:17273 Date: 2013-09-24T22:02:39+02:00 List-Id: Le 24/09/2013 21:27, Adam Beneschan a écrit : > Even if the compiler knew Accessibility_Level_Test were the main > subprogram, nothing would prevent some other subprogram from calling > it (recursively). Even without calling it recursively, exiting the main program is /not/ the end of the execution of an Ada Program. Tasks declared in library packages continue to run, there are even programs where the main procedure is begin-null;-end, all the work being done in library tasks. And of course, such tasks could use the pointer after the main subprogram is exited. Library level finalizable objects can also execute code after the main procedure is exited. You can think of it this way: the real main program is written by the compiler; it elaborates library packages, then calls the main procedure, then finalizes library packages (which involves waiting for the termination of library tasks). In Gnat, this main program is written in Ada, and you can find it in the b~xxx package. -- J-P. Rosen Adalog 2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX Tel: +33 1 45 29 21 52, Fax: +33 1 45 29 25 00 http://www.adalog.fr