This is the mail archive of the
mailing list for the GCC project.
[Bug fortran/33285] integer too big compile error in gfortran
- From: "kargl at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 3 Sep 2007 03:43:34 -0000
- Subject: [Bug fortran/33285] integer too big compile error in gfortran
- References: <firstname.lastname@example.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #5 from kargl at gcc dot gnu dot org 2007-09-03 03:43 -------
(In reply to comment #4)
> (In reply to comment #2)
> > The number 2147483648 is too big. The minus sign is a unary operator.
> > Either use the compiler option that Jerry mentioned or use 'k = - huge(k) - 1'
> option: -fno-range-check is supposed to be the default for the compiler
Huh? No, the default for the compiler is to perform range checking.
> "In some cases, options have positive and negative forms; the negative form of
> -ffoo would be -fno-foo. This manual documents only one of these two forms,
> whichever one is not the default.'
Looks like a bug in the documentation. I'll fix that shortly.
> It is in 4.1.X, looks like it has changed in 4.2.1
There was a bug in gfortran that allowed it to
accepted -2147483648. I fixed the bug with
2006-09-07 Steven G. Kargl <email@example.com>
* gfortran.h (gfc_integer_info): Eliminate max_int.
* arith.c (gfc_arith_init_1): Remove initialization of max_int.
(gfc_arith_done_1): Remove clearing of max_int.
(gfc_check_integer_range): Fix range chekcing of overflow.
* simplify.c (gfc_simplify_not): Construct mask that was max_int.
You can read about the problem here: