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

Paolo Carlini pcarlini@unitus.it
Mon Nov 18 13:24:00 GMT 2002


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.




More information about the Libstdc++ mailing list