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=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,14aa27db81ce3b40 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!f1g2000prb.googlegroups.com!not-for-mail From: Adam Beneschan Newsgroups: comp.lang.ada Subject: Re: How to exit an Ada program with (unix shell) error code? Date: Thu, 14 May 2009 08:34:44 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: <49ba30c9-a1e6-4346-8618-d256f87ac301@s31g2000vbp.googlegroups.com> NNTP-Posting-Host: 66.126.103.122 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1242315284 32616 127.0.0.1 (14 May 2009 15:34:44 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 14 May 2009 15:34:44 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: f1g2000prb.googlegroups.com; posting-host=66.126.103.122; posting-account=duW0ogkAAABjRdnxgLGXDfna0Gc6XqmQ User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.12) Gecko/20050922 Fedora/1.7.12-1.3.1,gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:5846 Date: 2009-05-14T08:34:44-07:00 List-Id: 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