Re: Exit code with Fortran 90
- From: harper@xxxxxxxxxxxxx (John Harper)
- Date: 31 Jan 2008 09:58:22 +1300
In article <13q13hiaul4q183@xxxxxxxxxxxxxxxxxx>,
Walter Spector <w6ws_xthisoutx@xxxxxxxxxxxxx> 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?
As Dan says, it is not required by the Fortran Standard per se.
However the POSIX Fortran Binding (1003.9-1992) does specify this
behavior (for small integer values.) As desirable as the feature
is, some compilers do it and some don't.
Even writing the code in octal is standard-conforming, e.g. NAG f95:
mahoe{~/Jfh} % cat stop666.f90
PRINT *,'Next statement is STOP',666
STOP 666
END
mahoe{~/Jfh} % nagf95 stop666.f90 ; ./a.out
Next statement is STOP 666
STOP: 1232
mahoe{~/Jfh} %
-- John Harper, School of Mathematics, Statistics and Computer Science,
Victoria University, PO Box 600, Wellington 6140, New Zealand
e-mail john.harper@xxxxxxxxx phone (+64)(4)463 5662 fax (+64)(4)463 5045
.
- References:
- Exit code with Fortran 90
- From: Andrea Francia
- Re: Exit code with Fortran 90
- From: Walter Spector
- Exit code with Fortran 90
- Prev by Date: Did anyone manage to get MATRAN compiled with g95?
- Next by Date: passing a variable number of args/vectors to a routine
- Previous by thread: Re: Exit code with Fortran 90
- Next by thread: Allocatable Arrays As Outputs
- Index(es):
Relevant Pages
|