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 Path: g2news2.google.com!news3.google.com!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!oleane.net!oleane!hunter.axlog.fr!nobody From: Jean-Pierre Rosen Newsgroups: comp.lang.ada Subject: Re: How to exit an Ada program with (unix shell) error code? Date: Tue, 05 May 2009 17:34:19 +0200 Organization: Adalog Message-ID: <2amptg.bg7.ln@hunter.axlog.fr> References: <49ba30c9-a1e6-4346-8618-d256f87ac301@s31g2000vbp.googlegroups.com> <8ef6052e-4f51-416b-bae7-ff83d7024267@t11g2000vbc.googlegroups.com> <62b174a9-c9c5-479c-9dd6-71916c102eb0@z16g2000prd.googlegroups.com> NNTP-Posting-Host: mailhost.axlog.fr Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: s1.news.oleane.net 1241530105 3212 195.25.228.57 (5 May 2009 13:28:25 GMT) X-Complaints-To: abuse@oleane.net NNTP-Posting-Date: Tue, 5 May 2009 13:28:25 +0000 (UTC) User-Agent: Thunderbird 2.0.0.21 (Windows/20090302) In-Reply-To: <62b174a9-c9c5-479c-9dd6-71916c102eb0@z16g2000prd.googlegroups.com> Xref: g2news2.google.com comp.lang.ada:5693 Date: 2009-05-05T17:34:19+02:00 List-Id: Adam Beneschan a �crit : > Right; and even if your Ada compiler *does* support functions that > return integers as main programs, and you're compiling for some > operating system with an "x" in its name (or Solaris), this does *not* > mean that the Ada compiler will treat the function result as the > status code. The compiler could decide that the function result is > something to be formatted and spit out onto standard output. If an > Ada implementation supports parameters and/or function results on main > programs, the language leaves it up to the implementation how those > are interpreted. There's no rule that says that the interpretation > has to mimic the behavior of the C language (thank God). So anon's > solution may work on GNAT, but it can't be assumed to work anywhere > else. > That's right from a legalistic point of view, but don't forget that compiler writers are not masochists. If an implementation supports functions returning integers as main programs, I would be very surprised if it was not interpreted as the return code, since this is what the consumer would expect... -- --------------------------------------------------------- J-P. Rosen (rosen@adalog.fr) Visit Adalog's web site at http://www.adalog.fr