[Boost-bugs] [Boost C++ Libraries] #2894: Incorrect type for buffer_size and pback_size parameters

Subject: [Boost-bugs] [Boost C++ Libraries] #2894: Incorrect type for buffer_size and pback_size parameters
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2009-03-27 11:17:50


#2894: Incorrect type for buffer_size and pback_size parameters
--------------------------------------------------+-------------------------
 Reporter: gareth.sylvester-bradley_at_[hidden] | Owner: turkanis
     Type: Bugs | Status: new
Milestone: Boost 1.39.0 | Component: iostreams
  Version: Boost 1.38.0 | Severity: Problem
 Keywords: |
--------------------------------------------------+-------------------------
 Documentation for
 [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] says:

 {{{
     void open( const T& t,
                std::streamsize buffer_size,
                std::streamsize pback_size );
 }}}

 That seems right to me.

 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.

 Explicitly casting arguments to int in client code works, but changing
 these parameters everywhere in Boost.Iostreams to std::streamsize fixes
 things for me.

 [*] E.g. at line 16 of
 [https://svn.boost.org/trac/boost/browser/trunk/boost/iostreams/detail/push_params.hpp
 boost/iostreams/detail/push_params.hpp]:

 {{{
     , int buffer_size = -1 , int pback_size = -1 \
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/2894>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:49:59 UTC