Fix things pointed up by Fred Fish's test suite; see ChangeLog.
[deliverable/binutils-gdb.git] / gdb / c-exp.y
index 192ed47c1cf13f089765de37b1e3f850ca655ea6..7d4b1777ad3d8c4b710567319945d3c80b06c393 100644 (file)
@@ -977,10 +977,11 @@ parse_number (p, len, parsed_float, putithere)
        }
       if (i >= base)
        return ERROR;           /* Invalid digit in this base */
-      if(!unsigned_p && (prevn >= n))
+      /* Portably test for overflow (only works for nonzero values, so make
+        a second check for zero).  */
+      if((prevn >= n) && n != 0)
         unsigned_p=1;          /* Try something unsigned */
-      /* Don't do the range check if n==i and i==0, since that special
-        case will give an overflow error. */
+      /* If range checking enabled, portably test for unsigned overflow.  */
       if(RANGE_CHECK && n!=0)
       {        
         if((unsigned_p && (unsigned)prevn >= (unsigned)n))
This page took 0.025023 seconds and 4 git commands to generate.