This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: libstdc++/10478: stdio_filebuf corrupts output for buffer sizes 1,2,3The
- From: paolo at gcc dot gnu dot org
- To: Hans dot Ranke at ei dot tum dot de, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org
- Date: 24 Apr 2003 11:39:22 -0000
- Subject: Re: libstdc++/10478: stdio_filebuf corrupts output for buffer sizes 1,2,3The
- Reply-to: paolo at gcc dot gnu dot org, Hans dot Ranke at ei dot tum dot de, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org, gcc-gnats at gcc dot gnu dot org
Synopsis: stdio_filebuf corrupts output for buffer sizes 1,2,3The
State-Changed-From-To: open->closed
State-Changed-By: paolo
State-Changed-When: Thu Apr 24 11:39:22 2003
State-Changed-Why:
Already fixed for the forthcoming 3.3 release with:
2003-03-31 Paolo Carlini <pcarlini at unitus dot it>
* include/ext/stdio_filebuf.h
(stdio_filebuf::stdio_filebuf(int, openmode, bool, size_t),
stdio_filebuf::stdio_filebuf(__c_file*, openmode, size_t):
_M_buf_size_opt == 0 means only "not to use an allocated buffer"
since a stack-based buffer is used for small values of the size_t
parameter.
* include/bits/fstream.tcc (basic_filebuf::_M_really_overflow).
If _M_buf_size != 0 flush out the buffer (any kind, stack-based too).
* testsuite/ext/stdio_filebuf_2.cc: New testfile.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=10478