comp.lang.ada
 help / color / mirror / Atom feed
From: "J-P. Rosen" <rosen@adalog.fr>
Subject: Re: Accessibility Levels and Library-Level Units
Date: Tue, 24 Sep 2013 22:02:39 +0200
Date: 2013-09-24T22:02:39+02:00	[thread overview]
Message-ID: <l1sr4v$eo$1@dont-email.me> (raw)
In-Reply-To: <5f5b3a27-574d-462e-ae09-dcc6ed3fd861@googlegroups.com>

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

  reply	other threads:[~2013-09-24 20:02 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-24 18:36 Accessibility Levels and Library-Level Units Eryndlia Mavourneen
2013-09-24 18:54 ` Eryndlia Mavourneen
2013-09-24 19:23   ` Adam Beneschan
2013-09-24 19:06 ` mockturtle
2013-09-25  7:46   ` Dmitry A. Kazakov
2013-09-24 19:13 ` mockturtle
2013-09-24 19:23   ` Eryndlia Mavourneen
2013-09-24 19:27   ` Adam Beneschan
2013-09-24 20:02     ` J-P. Rosen [this message]
2013-09-24 20:17       ` Eryndlia Mavourneen
2013-09-24 20:32       ` Adam Beneschan
2013-09-24 19:31 ` Jeffrey Carter
2013-09-24 19:43   ` Eryndlia Mavourneen
2013-09-24 19:59     ` Adam Beneschan
2013-09-24 20:50     ` Robert A Duff
2013-09-25 14:40       ` Eryndlia Mavourneen
2013-09-25 21:34         ` Robert A Duff
2013-09-26 12:46           ` Eryndlia Mavourneen
2013-09-29 21:36             ` Stephen Leake
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox