http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47921
Paolo Carlini <paolo.carlini at oracle dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jwakely.gcc at gmail dot | |com --- Comment #5 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-02-28 13:01:16 UTC --- This is a different issue. Anyway, concentrating on basic_streambuf<>::xsputn (I don't think we should fiddle that late with the deprecated strstream), note that __len is smaller than __buf_len, and typically __buf_len ~= 8192. Thus I would consider the problem rather minor. Anyway, I'm in favor of something like your first hunk, with a comment before about streamsize == ptrdiff_t, and using __gnu_cxx::__numeric_traits<int>::__max instead (thus avoiding bringing in the whole <limits>). Probably we used to be not careful enough in xsputn because streamsize is (was) normally 32 bits on 32-bit machines (being ptrdiff_t).