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: Thu, 14 May 2009 08:34:44 -0700 (PDT)
Date: 2009-05-14T08:34:44-07:00	[thread overview]
Message-ID: <d30a0294-f9a2-43ec-9cae-777995001e6c@f1g2000prb.googlegroups.com> (raw)
In-Reply-To: PKLOl.226644$4m1.46779@bgtnsc05-news.ops.worldnet.att.net

On May 13, 7:55 pm, a...@anon.org (anon) wrote:

> Now, all OS's (AT&T OS port, Linux, and Windows) shell or application
> loaders, calls a program using the following format:
>
>  Exit_Status := Application.all ( Augment_Count,
>                                   Argument_List,
>                                   Environment_List ) ;

I'll have to bow out of this argument, because you're making arguments
that I've already refuted multiple times, and you seem not to notice.
In particular, you still seem to assume that the OS is going to call
the Ada main subprogram directly, and I've dealt with this mistaken
assumption at least twice already.  I don't feel like taking time
repeating myself any more.  But I did want to point out a few places
where you're reading something in the RM that isn't there:


> This is defined from the "implementation's execution environment" which
> RM 1.1.3 (6) states that if it is "impossible or impractical" then Ada
> variations are permitted. Which states that all Ada partitions that are
> executed under this type of OS which calls a program as a function shall
> return a value aka Exit_Status.

This is a huge stretch of interpretation.  This paragraph is saying,
basically, that variations from the language are permitted if it's
impossible to implement things the way the standard says in a
particular execution environment; and you're interpreting this as a
*requirement* that the result of a function used as a main subprogram
must be an exit status.


> Then you have RM 10.2 (21) which states that Ada must conform to the
> "implementation's execution environment". By return an exit status
> unless it terminates abnormally since it was called as a function.
>
> 10.2  (21) A call to the main subprogram, if the partition has one. If
>            the main subprogram has parameters, they are passed; where
>            the actuals come from is implementation defined. What
>            happens to the result of a main function is also
>            implementation defined.

How does this state that "Ada must conform to the implementation's
execution environment", as you say?  This paragraph doesn't even
mention the execution environment.  All it says is that "what happens
to the result of a main function is implementation defined", and the
phrase "implementation defined" means pretty much "whatever the
compiler writer chooses it to mean".  If you believe "implementation
defined" means "determined in some way by the implementation's
execution environment", or "required to conform to it", well then---
sorry, you are just not familiar with commonly used computer
terminology.


> 1.1.3 (12) Any result returned or exception propagated from a main
>            subprogram (see 10.2) or an exported subprogram (see
>            Annex B) to an external caller;

The effect of this paragraph is to define the result of a main
subprogram as an "external interaction".  That's all it does.  The
section of the RM is giving a definition of the term "external
interaction".  It makes no statement about what the result should be.

                                  -- Adam



  parent reply	other threads:[~2009-05-14 15:34 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 [this message]
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
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