Re: Exit code with Fortran 90



"Andrea Francia" <afrancia@xxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:47b06672$0$4787$4fafbaef@xxxxxxxxxxxxxxxxxxxxxx
Andrea Francia wrote:
If I use the istruction
stop n
where n is a integer I found that the program terminate with n as exit code.

I see that this happen compiling when I use the GNU Fortran compiler (gfortran).

Is this behaviour standard, or it is a special behaviour of gfortran?
Thanks everyone for the replies, now I know that this behaviour is not part of the Fortran 95 standard, but it is part of the 1003.9-1992 standard and may be not avaialable on each Fortran 95 implementation.

Sending the stop code to the OS as an exit status is not now part of the Fortran standard.

However, Fortran 2008 will include an enhanced STOP statement. Two of the enhancements include displaying the stop code on ERROR_UNIT and using it as the process exit status, if the processor has such a concept. The details are in J3 paper 05-231r4.

--
Craig Dedo
17130 W. Burleigh Place
P. O. Box 423
Brookfield, WI 53008-0423
Voice: (262) 783-5869
Fax: (262) 783-5928
Mobile: (414) 412-5869
E-mail: <cdedo@xxxxxxxxx> or <craig@xxxxxxxxxx>

.



Relevant Pages

  • Re: How to compile Mopac 7.1 using g77 or gfortran
    ... ld returned 1 exit status ... or by a means other than Fortran." ... "Intrinsic procedures are ... defined in this standard or provided by a processor". ...
    (comp.lang.fortran)
  • Re: Exit code with Fortran 90
    ... where n is a integer I found that the program terminate with n as exit ... I see that this happen compiling when I use the GNU Fortran compiler ... it is not required by the Fortran Standard per se. ...
    (comp.lang.fortran)
  • Re: A few syntax questions
    ... I think putting them in the 'action-stmt' syntax rule ... If I were to redo the bnf from scratch, ... I guess that means that a standard conforming compiler is supposed to overflow. ... I am hoping that F2003 features will regain some respect for Fortran in CS departments,, and not just be coinsidered an old archaic language for old programs, but such strong support of archaic Fortran standards is a major reason why Fortran popularity continues to dwindle. ...
    (comp.lang.fortran)
  • Re: If you were inventing CoBOL...
    ... I can't get COBOL to produce a *floating* version of the most common ... EXIT PARAGRAPH and EXIT SECTION provide good support for structure ... disallowed in other contexts in the '02 standard. ... EXIT PARAGRAPH and EXIT SECTION are big helps here. ...
    (comp.lang.cobol)
  • Re: Form k = i + j and test for overflow.
    ... Last night you suggested I was forgetting that overflow violates ... the Fortran standard. ... test that wouldn't work on the most common of implementations. ... that conforms to the Fortran standard. ...
    (comp.lang.fortran)