Re: Exit code with Fortran 90



Joseph Huber wrote:
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?


The standard only says:

"...the stop code, if any, is available in a processor-dependent manner."

And I know at least one implementation (VMS DEC/HP Fortran) which
just displays the code (or string), and does not pass it to program exit
status.

Not a very desirable implementation. it is quite useful when implemented as an exit code that can be passed to other process/command interpreters.

--

Gary Scott
mailto:garylscott@sbcglobal dot net

Fortran Library: http://www.fortranlib.com

Support the Original G95 Project: http://www.g95.org
-OR-
Support the GNU GFortran Project: http://gcc.gnu.org/fortran/index.html

If you want to do the impossible, don't hire an expert because he knows it can't be done.

-- Henry Ford
.



Relevant Pages

  • Re: Exit code with Fortran 90
    ... I see that this happen compiling when I use the GNU Fortran compiler. ... 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. ... The most common I think I've seen is either stdout or process exit code. ...
    (comp.lang.fortran)
  • Re: Exit code with Fortran 90
    ... 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. ... 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. ...
    (comp.lang.fortran)
  • Re: Exit code with Fortran 90
    ... 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. ... Is this behaviour standard, or it is a special behaviour of gfortran? ...
    (comp.lang.fortran)
  • Execute concatenated position independent code within dynamic memory
    ... and exit code (I'm compiling at -O0 and there's forced register pressure): ... I have concatenated the entry and exit code in dynamic memory: ...
    (comp.os.linux.development.apps)
  • Re: Exit code with Fortran 90
    ... 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. ...
    (comp.lang.fortran)