On Sun, May 9, 2010 at 19:20, Jerry DeLisle<jvdelisle@verizon.net> wrote:
I will change it to zero for ERROR STOP
FWIW, I agree with your later mail and Tobias that in this case we are
better of ignoring the standard recommendation and keeping the
non-zero exit code for ERROR STOP.
The stop code is scalar-int-constant-expr. Currently:
Hmm, my understanding is that scalar-int-constant-expr means that it
must be a literal or a named constant (there's a separate
"(signed)-int-literal-constant" for stuff that must be a literal)?
E.g. the following ought to be allowed:
program stoptest
implicit none
integer, parameter :: i = -1
stop i
end program stoptest
pr43851.f90:10.16:
stop 9223372036854775807
1
Error: Integer too large at (1)
However, I think a 32 bit integer is more that adequate for now. We do not
allow negative codes either.
Absolutely, especially considering POSIX masks out all but the 8 least
significant bits anyway, so the possible return codes are between 0
and 256 in any case.
However, in case my reasoning above is correct, we should allow 8 byte
integers due to -fdefault-integer-8 (my preferred solution to this
would be to typecast in the frontend, as I previously mentioned), and
also negative values.