comp.lang.ada
 help / color / mirror / Atom feed
From: Adam Beneschan <adam@irvine.com>
Subject: Re: How to exit an Ada program with (unix shell) error code?
Date: Tue, 5 May 2009 14:01:27 -0700 (PDT)
Date: 2009-05-05T14:01:27-07:00	[thread overview]
Message-ID: <11acf6a5-d0cb-4c22-b3e0-1ff833348923@p6g2000pre.googlegroups.com> (raw)
In-Reply-To: gC1Ml.199153$4m1.122220@bgtnsc05-news.ops.worldnet.att.net

On May 5, 1:48 pm, a...@anon.org (anon) wrote:
> Actually, Adam the design for all OS currectly use today states that if the
> program returns the "Accumulator Register" will contain the program exit
> code. Been a standard for at least 40 years.

Define "the program".

"The program" that is run by the OS is not necessarily the Ada main
subprogram.  In fact, it probably won't be.  An Ada subprogram used as
the main program isn't going to have all the library package
elaboration or finalization code run by the Ada environment task (RM
10.2), since it is compiled separately, and at the time it's compiled
the Ada compiler won't necessarily know that it's going to be the main
program.  Therefore, the "program" is probably going to be some sort
of wrapper that calls the initialization code, calls the main
subprogram, then calls the finalization code.  There's no standard
anywhere that says that this wrapper must preserve the value that the
Ada main subprogram sticks in the accumulator register (or wherever
function results are stored).  [P.S. Note that the environment task is
a *task* and has no return value, in Ada semantics, for what it's
worth.]

So your comment isn't particularly relevant.  It certainly doesn't
prove anything.

                                -- Adam



  reply	other threads:[~2009-05-05 21:01 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-04  9:08 How to exit an Ada program with (unix shell) error code? reinkor
2009-05-04  9:17 ` Samuel Tardieu
2009-05-04  9:26   ` reinkor
2009-05-04  9:31     ` Ludovic Brenta
2009-05-04  9:47       ` reinkor
2009-05-04  9:54         ` Martin
2009-05-04 11:38           ` sjw
2009-05-04 10:07       ` stefan-lucks
2009-05-04 13:42     ` Robert A Duff
2009-05-04 16:19       ` Martin
2009-05-07  9:48         ` anon
2009-05-04 16:09 ` anon
2009-05-05 10:49   ` Rob Norris
2009-05-05 11:15     ` Georg Bauhaus
2009-05-05 11:43   ` Martin
2009-05-05 14:57     ` Adam Beneschan
2009-05-05 15:34       ` Jean-Pierre Rosen
2009-05-06 15:28         ` Adam Beneschan
2009-05-06 22:10           ` Randy Brukardt
2009-05-07  9:08           ` anon
2009-05-07 10:01             ` Georg Bauhaus
2009-05-07 11:22               ` anon
2009-05-07 12:08                 ` Martin
2009-05-07 13:34                 ` Georg Bauhaus
2009-05-07 16:26             ` Adam Beneschan
2009-05-08 10:17               ` anon
2009-05-12 22:55                 ` Adam Beneschan
2009-05-14  2:55                   ` anon
2009-05-14  8:04                     ` Martin
2009-05-14  8:39                     ` Martin
2009-05-14  8:45                       ` Martin
2009-05-14  9:34                       ` Ludovic Brenta
2009-05-14 10:05                         ` Martin
2009-05-14 12:38                           ` Georg Bauhaus
2009-05-14 15:34                     ` Adam Beneschan
2009-05-15 10:20                       ` anon
2009-05-15 11:19                         ` Martin
2009-05-05 20:48       ` anon
2009-05-05 21:01         ` Adam Beneschan [this message]
2009-05-06 11:30         ` Hibou57 (Yannick Duchêne)
2009-05-05 20:31     ` anon
2009-05-05 21:27       ` Martin
2009-05-06  8:41         ` anon
2009-05-06  9:14           ` Martin
2009-05-06 11:41             ` Georg Bauhaus
replies disabled

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