This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [Patch] Remove basic_filebuf::_M_last_overflowed
- From: Benjamin Kosnik <bkoz at redhat dot com>
- To: Paolo Carlini <pcarlini at unitus dot it>
- Cc: libstdc++ at gcc dot gnu dot org
- Date: Tue, 6 May 2003 21:35:19 -0500
- Subject: Re: [Patch] Remove basic_filebuf::_M_last_overflowed
- References: <3EB3AEDD.5010204@unitus.it>
>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():
Hmm. Did you see the unfinished parts of filebuf::close? That's why this
data member exists. See 27.8.1.3 - Member functions p6 and tell me if
you think it can be done without this.
>And the only place where it was *apparently* set to true
>was _M_overflow().
>
>However, overflow(), just before returning, set it back
>to false!
This is a bug and should be fixed. Just move
_M_last_overflowed = false; // Set in _M_overflow, below.
to a point ahead of the _M_overflow call.
-benjamin