This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [Patch] Change _M_overflow to call _M_convert_to_external once
- 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: Thu, 15 May 2003 17:58:06 -0500
- Subject: Re: [Patch] Change _M_overflow to call _M_convert_to_external once
- References: <3EC278F9.6080405@unitus.it>
>1- setbuf(s(!=null), n(==1)) is simply ignored. This is allowed
>by the standard and not a big loss, probably, but still a change
>of behavior.
I think this is the correct thing to do. This case is implementation
defined behavior. I don't think this should be identical behavior wise
to an unbuffered stream ("unbuffer this stream" as opposed "to use a new
buffer that's very small").
>2- setbuf(0,0) leads internally to _M_buf_size == 1, that is,
>actually, zero-sized get and put areas (null pointers). Using
>this value instead of _M_buf_size == 0 simplifies _M_set_buffer.
This is reverted. It's causing problems, which you've hacked around
later in the patch. The simplifications were small anyway.
I'm working on fixing this up properly (which means adding setbuf(0,0)
testcases and fixing them up, since this stuff is not getting caught as
it should be, as well as some of the other GNATS issues as referenced
below), am hoping to convince you do work on the open mode issues with
xsgetn/putn/putc/etc issues that we discussed previously. What say you?
>3- I have renamed _M_set_determinate as _M_set_buffer, and
>removed _M_set_indeterminate which was trivially calling
>_M_set_determinate.
Great. I thought this was coming...
>4- Two tests had to be tweaked: one relied on a BUFSIZ sized put
>area, the other on a single-char stdio_filebuf.
In, for now.
>5- Before and after this patch, unbuffered basic_filebuf::_M_overflow
>and _M_underflow (a.k.a., libstdc++/9404) are still missing.
>Benjamin, which strategy do you prefer? Adding a special case to
>the current versions would now be easy.
I'm on this.
I've checked this in with the modifications as above, thanks.
-benjamin