This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch, fortran] Add _gfortran_error_stop_numeric


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.

-- 
Janne Blomqvist


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]