This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC 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]

[Bug fortran/30985] New: Misleading error message for -huge(integer)-1


If one inputs a variable which is (-huge(i)-1), gfortran outputs:

  i = -2147483648
                1
Error: Integer too big for its kind at (1)

This can be very irritating as the number is representable hardware wise, even
if  it is not a Fortran number (symmetrically around the zero).

I had a program, which didn't work (PR30981) and thus I used  "print *, i"
which showed: -2147483648. It is then very counterintuitive that one cannot
enter the number directly.

Maybe a more explicit error message should be given for (-huge(i)-1). In
addition, maybe one could point to "-fno-range-check"? I know we don't point to
compiler options in error messages so far, but for this case it might make
sense. (Analogously for
data x/too-big-BOZ, overflowing on purpose/.)

[For some errors, I'd also like to see a pointer to -std=legacy as I often
don't realize that it is allowed there.]


-- 
           Summary: Misleading error message for -huge(integer)-1
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: burnus at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30985


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