This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [v3] Fix second half of libstdc++/6745


Jonathan Lennox wrote:

Paolo Carlini writes:

+#ifdef _GLIBCPP_HAVE_ISATTY + size_t __size = isatty(0) ? 1 : static_cast<size_t>(BUFSIZ);
+#else
+ size_t __size = 1;
+#endif

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.

Hummm...
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!).

Thanks, Paolo.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]