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/33001] error with hexadecimal DATA



------- Comment #2 from burnus at gcc dot gnu dot org  2007-08-06 12:11 -------
      DATA LARGE(1), LARGE(2) / Z'FFFFFFFF', Z'7FEFFFFF' /              
Error: Arithmetic overflow converting INTEGER(16) to INTEGER(4) at (1)

The error message is correct: You cannot fit the number into an INTEGER(4) as
this is bigger than "HUGE(0)".

As the overflow is intended, one can use   -fno-range-check   to disable this
checking and thus the error message.

I think one should do here the same as in primary.c and add the following to
the error message:

--- arith.c     (revision 127237)
+++ arith.c     (working copy)
@@ -1983,3 +1983,4 @@ arith_error (arith rc, gfc_typespec *fro
     case ARITH_OVERFLOW:
-      gfc_error ("Arithmetic overflow converting %s to %s at %L",
+      gfc_error ("Arithmetic overflow converting %s to %s at %L. This check "
+                "can be disabled with the option -fno-range-check",
                 gfc_typename (from), gfc_typename (to), where);


-- 

burnus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |burnus at gcc dot gnu dot
                   |                            |org
  GCC build triplet|x86_64-redhat-linux         |
   GCC host triplet|x86_64-redhat-linux         |
 GCC target triplet|x86_64-redhat-linux         |


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


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