[Patch] Remove basic_filebuf::_M_last_overflowed

Paolo Carlini pcarlini@unitus.it
Sat May 3 11:57:00 GMT 2003


Hi,

this was real fun!

In std_fstream.h we had this comment

    // XXX Needed?
    bool            _M_last_overflowed;

so I had a look. The only place where it was used
was seekeoff():

    // Sync the internal and external streams.
    // out
    if (__testput || _M_last_overflowed)
      {
        // Part one: update the output sequence.

And the only place where it was *apparently* set to true
was _M_overflow().

However, overflow(), just before returning, set it back
to false! And I went ahead: in all the other places where
_M_overflow() was called, before returning _M_last_overflowed
was also set back to false (*)!

Therefore, it could *never* happen that it was true in
that 'if' inside seekoff()! (QED ;)

Tested x86-linux, ok for trunk?

Paolo.

(*) And/or seekoff() was not called in the middle
(e.g., _M_underflow()).
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: CL_last_overflowed
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20030503/39a7593d/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch_last_overflowed
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20030503/39a7593d/attachment-0001.ksh>


More information about the Libstdc++ mailing list