* c-exp.y (parse_number): Make it so that integer constants are
authorJim Kingdon <jkingdon@engr.sgi.com>
Sat, 15 Jan 1994 19:51:56 +0000 (19:51 +0000)
committerJim Kingdon <jkingdon@engr.sgi.com>
Sat, 15 Jan 1994 19:51:56 +0000 (19:51 +0000)
builtin_type_long_long if builtin_type_long isn't big enough or if
an "LL" suffix is used.  Properly handle "UL" or "LU" suffixes.

gdb/c-exp.y

index 6a96eb11ee42266dbe64bafd88b44edaf8f43292..08f7548d566b7ecafc44c091a68ae1d2520eeb8a 100644 (file)
@@ -1046,7 +1046,13 @@ parse_number (p, len, parsed_float, putithere)
     }
   else
     {
-      high_bit = ((unsigned LONGEST)1) << (TARGET_LONG_LONG_BIT - 1);
+      high_bit = (((unsigned LONGEST)1)
+                 << (TARGET_LONG_LONG_BIT - 32 - 1)
+                 << 16
+                 << 16);
+      if (high_bit == 0)
+       /* A long long does not fit in a LONGEST.  */
+       high_bit = (unsigned LONGEST)1 << sizeof (LONGEST) * HOST_CHAR_BIT - 1;
       unsigned_type = builtin_type_unsigned_long_long;
       signed_type = builtin_type_long_long;
     }