public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/30985]  New: Misleading error message for -huge(integer)-1
@ 2007-02-27 20:23 burnus at gcc dot gnu dot org
  2007-02-27 20:49 ` [Bug fortran/30985] " kargl at gcc dot gnu dot org
  2007-02-27 21:50 ` pinskia at gcc dot gnu dot org
  0 siblings, 2 replies; 3+ messages in thread
From: burnus at gcc dot gnu dot org @ 2007-02-27 20:23 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug fortran/30985] Misleading error message for -huge(integer)-1
  2007-02-27 20:23 [Bug fortran/30985] New: Misleading error message for -huge(integer)-1 burnus at gcc dot gnu dot org
@ 2007-02-27 20:49 ` kargl at gcc dot gnu dot org
  2007-02-27 21:50 ` pinskia at gcc dot gnu dot org
  1 sibling, 0 replies; 3+ messages in thread
From: kargl at gcc dot gnu dot org @ 2007-02-27 20:49 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from kargl at gcc dot gnu dot org  2007-02-27 20:49 -------
This is a bogus PR.  The are no negative numbers.
This is a unary minus operation and 2147483648
is too big for INTEGER(4).  The only method to
get the most negative value is -HUGE() - 1.


-- 

kargl at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kargl at gcc dot gnu dot org


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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug fortran/30985] Misleading error message for -huge(integer)-1
  2007-02-27 20:23 [Bug fortran/30985] New: Misleading error message for -huge(integer)-1 burnus at gcc dot gnu dot org
  2007-02-27 20:49 ` [Bug fortran/30985] " kargl at gcc dot gnu dot org
@ 2007-02-27 21:50 ` pinskia at gcc dot gnu dot org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-02-27 21:50 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from pinskia at gcc dot gnu dot org  2007-02-27 21:50 -------


*** This bug has been marked as a duplicate of 29580 ***


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |DUPLICATE


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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-02-27 21:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-27 20:23 [Bug fortran/30985] New: Misleading error message for -huge(integer)-1 burnus at gcc dot gnu dot org
2007-02-27 20:49 ` [Bug fortran/30985] " kargl at gcc dot gnu dot org
2007-02-27 21:50 ` pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).