Boost C++ Libraries: Ticket #2894: Incorrect type for buffer_size and pback_size parameters https://svn.boost.org/trac10/ticket/2894 <p> Documentation for <a href="http://www.boost.org/doc/libs/1_38_0/libs/iostreams/doc/index.html?page=http%3A//www.boost.org/doc/libs/1_38_0/libs/iostreams/doc/guide/generic_streams.html%23stream_open">stream::open</a> says: </p> <pre class="wiki"> void open( const T&amp; t, std::streamsize buffer_size, std::streamsize pback_size ); </pre><p> That seems right to me. </p> <p> However, on some environments (64-bit), passing std::streamsize arguments causes compilation failure, since the actual implementation has these parameters as int everywhere [*], and the template forwarding stream constructor/open don't work correctly. </p> <p> Explicitly casting arguments to int in client code works, but changing these parameters everywhere in Boost.Iostreams to std::streamsize fixes things for me. </p> <p> [*] E.g. at line 16 of <a class="ext-link" href="https://svn.boost.org/trac/boost/browser/trunk/boost/iostreams/detail/push_params.hpp"><span class="icon">​</span>boost/iostreams/detail/push_params.hpp</a>: </p> <pre class="wiki"> , int buffer_size = -1 , int pback_size = -1 \ </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/2894 Trac 1.4.3 Daniel James Thu, 12 Nov 2009 19:19:37 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/2894#comment:1 https://svn.boost.org/trac10/ticket/2894#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/57608" title="Hopefully fix #2894. By Richard Smith">[57608]</a>) Hopefully fix <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/2894" title="#2894: Bugs: Incorrect type for buffer_size and pback_size parameters (closed: fixed)">#2894</a>. </p> <p> By Richard Smith </p> Ticket Richard Webb <richard.webb@…> Fri, 13 Nov 2009 13:36:15 GMT status, version changed; resolution deleted https://svn.boost.org/trac10/ticket/2894#comment:2 https://svn.boost.org/trac10/ticket/2894#comment:2 <ul> <li><strong>status</strong> <span class="trac-field-old">closed</span> → <span class="trac-field-new">reopened</span> </li> <li><strong>version</strong> <span class="trac-field-old">Boost 1.38.0</span> → <span class="trac-field-new">Boost Development Trunk</span> </li> <li><strong>resolution</strong> <span class="trac-field-deleted">fixed</span> </li> </ul> <p> It looks like the change to detail/streambuf/indirect_streambuf.hpp has caused a bunch of regression test failures. e.g. from <a href="http://www.boost.org/development/tests/trunk/developer/iostreams.html">http://www.boost.org/development/tests/trunk/developer/iostreams.html</a> : </p> <p> From VC10: indirect_streambuf.hpp(171) : error C2782: 'const _Ty &amp;std::max(const _Ty &amp;,const _Ty &amp;)' : template parameter '_Ty' is ambiguous </p> <p> From GCC 4.4.1: indirect_streambuf.hpp:171: error: no matching function for call to ???max(int, std::streamsize&amp;)?? </p> <p> Changing line 171 of indirect_streambuf.hpp to cast the '2' to a std::streamsize fixes the failures on VC10. </p> Ticket mloskot <mateusz@…> Sat, 14 Nov 2009 15:44:43 GMT cc set https://svn.boost.org/trac10/ticket/2894#comment:3 https://svn.boost.org/trac10/ticket/2894#comment:3 <ul> <li><strong>cc</strong> <span class="trac-author">mateusz@…</span> added </li> </ul> <p> Just for records, link to file/line in current revision [source:trunk/boost/iostreams/detail/push_params.hpp@57608#L16 push_params.hpp:16] - it may be changed or even removed in future revs. </p> Ticket Richard Webb <richard.webb@…> Tue, 17 Nov 2009 15:02:34 GMT <link>https://svn.boost.org/trac10/ticket/2894#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/2894#comment:4</guid> <description> <p> Looks like indirect_streambuf.hpp has been fixed in <a class="changeset" href="https://svn.boost.org/trac10/changeset/57710" title="IOStreams: fixing compilation error on VC2010">[57710]</a>. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Daniel James</dc:creator> <pubDate>Sat, 02 Jan 2010 11:51:43 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/2894#comment:5 https://svn.boost.org/trac10/ticket/2894#comment:5 <ul> <li><strong>status</strong> <span class="trac-field-old">reopened</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/58633" title="Merge iostream fixes, mostly by Richard Smith. Fixes #3612, #3311, ...">[58633]</a>) Merge iostream fixes, mostly by Richard Smith. </p> <p> Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/3612" title="#3612: Bugs: Throwing heap-allocated exceptions (closed: fixed)">#3612</a>, <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/3311" title="#3311: Bugs: Unintentionally unthrown exceptions (closed: fixed)">#3311</a>, <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/2094" title="#2094: Bugs: iostreams fails to compile with -fno-exceptions (closed: fixed)">#2094</a>, <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/3010" title="#3010: Bugs: Missing include guard in boost/iostreams/device/mapped_file.hpp (closed: fixed)">#3010</a>, <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/2894" title="#2894: Bugs: Incorrect type for buffer_size and pback_size parameters (closed: fixed)">#2894</a>, <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/3011" title="#3011: Bugs: code_converter doesn't support boost::ref( std::istream ) (closed: fixed)">#3011</a>, <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/3352" title="#3352: Patches: CRC not correctly computed on x64 during decompression of gzip archive (closed: fixed)">#3352</a>, <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/3505" title="#3505: Bugs: mapped_file windows handle validity check patch against 1.40.0 (closed: fixed)">#3505</a>. </p> Ticket