This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: unbuffered input
- From: Phil Edwards <phil at jaj dot com>
- To: David Rasmussen <david dot rasmussen at gmx dot net>
- Cc: libstdc++ at gcc dot gnu dot org
- Date: Fri, 24 May 2002 17:21:51 -0400
- Subject: Re: unbuffered input
- References: <3CEA4313.8030204@gmx.net> <20020521150043.A7732@disaster.basement.lan> <3CEAB725.8050609@gmx.net> <20020521184807.A9591@disaster.basement.lan> <20020521185918.A9693@disaster.basement.lan> <3CEADD57.3060908@gmx.net>
On Wed, May 22, 2002 at 01:50:47AM +0200, David Rasmussen wrote:
> So, will I have to file a problem report? When do you think this will be
> fixed, and more importantly, is there some sort of quick fix, either a
> workaround, or maybe a patch that will actually make the buffer work
> correctly?
PRs are good in any case, both to provide a record of what happens, and
to make certain we don't forget to fix anything.
There is no quick fix that I can think of. The problem is in the 'if'
conditions being tested in the std::basic_filebuf::setbuf() function,
in bits/fstream.tcc, line 460-ish. We want to take the first branch,
instead we take neither branch. The call to is_open should be replaced.
There is no has_this_buffer_done_any_IO_yet function, but if there were,
that's what should be called instead. I haven't looked any further.
If you file the PR, you get the added bonus of being instantly notified
as soon as it's fixed. :-)
Phil
--
If ye love wealth greater than liberty, the tranquility of servitude greater
than the animating contest for freedom, go home and leave us in peace. We seek
not your counsel, nor your arms. Crouch down and lick the hand that feeds you;
and may posterity forget that ye were our countrymen. - Samuel Adams