------- Comment #2 from pcarlini at suse dot de  2007-12-10 19:26 -------
What you call "corruption of future reads" is just failbit set, due to
underflow, evidently. You can simply reset it to goodbit and proceed. That
said, I have no idea why the behavior is different in 4.2.2 vs 4.0.1, since
nothing changed in the relevant part of the C++ library (of our competence),
which simply does in both releases:

          double __d = strtod(__s, &__sanity);
          if (__sanity != __s && errno != ERANGE)
            __v = __d;
          else
            __err |= ios_base::failbit;

Note, however, that it is implementation defined in the underlying C library
whether errno is set to ERANGE by strtod on underflow. Maybe you also updated
the C library, which changed behavior lately on darwin? Anyway, it is very
unlikely that at this point in the release story of 4.2.x the C++ library side
will change. On the other hand, it will change for 4.3.0: there we avoid using
ERANGE completely and underflow never sets failbit, the behavior that you want.


-- 

pcarlini at suse dot de changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|c++                         |libstdc++


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

Reply via email to