OSDN Git Service

* lex.c (real_yylex) : Change integer literal overflow handling to
authorgavin <gavin@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 1 Jul 1999 11:22:17 +0000 (11:22 +0000)
committergavin <gavin@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 1 Jul 1999 11:22:17 +0000 (11:22 +0000)
be like c-lex.c.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@27879 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/cp/ChangeLog
gcc/cp/lex.c

index c71ffd7..25a0005 100644 (file)
@@ -1,5 +1,8 @@
 1999-07-01  Gavin Romig-Koch  <gavin@cygnus.com>
 
+       * lex.c (real_yylex) : Change integer literal overflow handling to
+       be like c-lex.c.
+
        * lex.c (real_yylex): Improve 'integer constant out of range' messages.
 
 1999-06-28  Richard Henderson  <rth@cygnus.com>
index 1e26726..5448990 100644 (file)
@@ -3857,7 +3857,7 @@ real_yylex ()
            int spec_long = 0;
            int spec_long_long = 0;
            int spec_imag = 0;
-           int bytes, warn;
+           int warn;
 
            while (1)
              {
@@ -3895,25 +3895,10 @@ real_yylex ()
                c = getch ();
              }
 
-           /* If the constant is not long long and it won't fit in an
-              unsigned long, or if the constant is long long and won't fit
-              in an unsigned long long, then warn that the constant is out
-              of range.  */
-
-           /* ??? This assumes that long long and long integer types are
-              a multiple of 8 bits.  This better than the original code
-              though which assumed that long was exactly 32 bits and long
-              long was exactly 64 bits.  */
-
-           if (spec_long_long)
-             bytes = TYPE_PRECISION (long_long_integer_type_node) / 8;
-           else
-             bytes = TYPE_PRECISION (long_integer_type_node) / 8;
+           /* If it won't fit in the host's representation for integers,
+              then pedwarn. */
 
            warn = overflow;
-           for (i = bytes; i < TOTAL_PARTS; i++)
-             if (parts[i])
-               warn = 1;
            if (warn)
              pedwarn ("integer constant is too large for this configuration of the compiler - truncated to %d bits", HOST_BITS_PER_WIDE_INT * 2);