[Bug fortran/33285] integer too big compile error in gfortran
kargl at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Mon Sep 3 03:58:00 GMT 2007
------- Comment #6 from kargl at gcc dot gnu dot org 2007-09-03 03:58 -------
(In reply to comment #3)
> (In reply to comment #1)
>> This is assuming that an asymmetric range is permitted in Fortran which
>> I think
>> it is not. You can use -fno-range-check to disable this check.
>>
>
> In the IBM XL Fortran 90 manual:
> pg 19
> I quote: for Integer Kind parameter 4 range of value "-2147483648 through to
> 2147483647"
> namely -(2^31) to (2^31 -1)
The IBM XL manual isn't the Fortran standard.
> Compiling this using gcc-gfortran-4.1.X and gcc-g77-3.X
> works
It was a bug in older versions of gfortran.
>
> It is a Fortran standard!
>
The Fortran 95 standard doesn't specify the values that an integer
can take. It does specify the model numbers for integer. There is
a difference!
In "i = - 2147483648", the RHS is an expression. It is a unary minus
operator with the operand 2147483648, which is greater than 2^31-1.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33285
More information about the Gcc-bugs
mailing list