This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/33296] nearest(huge(1.0),1.0) gives an error
- From: "dominiq at lps dot ens dot fr" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 4 Sep 2007 12:05:35 -0000
- Subject: [Bug fortran/33296] nearest(huge(1.0),1.0) gives an error
- References: <bug-33296-12313@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from dominiq at lps dot ens dot fr 2007-09-04 12:05 -------
I don't think the PR is invalid:
(1) at least it should go the "enhancement" with the addition of " This check
can be disabled with the option -fno-range-check" as in
print *, huge(0), -2147483648
1
Error: Integer too big for its kind at (1). This check can be disabled with the
option -fno-range-check
(2) I think the two cases are totally different:
huge(0)+1 cannot be represented in the integer model, thus the overflow;
as soon as the compiler knows INF/NAN (and gfortran does), I think
nearest(huge(1.0),1.0)==+Inf is part of the floating point model and should not
throw even a warning (even with -std=xx -pedantic).
I don't want to start a flame war of this issue, but look at the number of
mails, answers, noise, ..., generated by -2147483648 (note that I did not write
-(2147483648)!-).
--
dominiq at lps dot ens dot fr changed:
What |Removed |Added
----------------------------------------------------------------------------
Severity|normal |minor
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33296