This is the mail archive of the
mailing list for the GCC project.
Re: [v3] Fix second half of libstdc++/6745
- From: Paolo Carlini <pcarlini at unitus dot it>
- To: Jonathan Lennox <lennox at cs dot columbia dot edu>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, libstdc++ at gcc dot gnu dot org
- Date: Mon, 18 Nov 2002 22:00:08 +0100
- Subject: Re: [v3] Fix second half of libstdc++/6745
- References: <3DD948CF.email@example.com> <firstname.lastname@example.org>
Jonathan Lennox wrote:
Paolo Carlini writes:Hummm...
+ size_t __size = isatty(0) ? 1 : static_cast<size_t>(BUFSIZ);
+ size_t __size = 1;
One problem with this. __copy_streambufs is a general function -- it's not
just used to copy from stdin. However, this patch conditionalizes the
function's buffer size on isatty(0), even though in many cases when it's
used, (i.e., copying from a readable buffer other than cin->rdbuf()), the
nature of stdin is irrelevant.
Could you possibly post an example accompanying your argument (which is
probably correct!)? I'd like to see some code which incorrectly leads to
1 whereas BUFSIZ would be perfectly ok (and faster!).