Modify

Ticket #2894 (closed Bugs: fixed)

Opened 5 years ago

Last modified 4 years ago

Incorrect type for buffer_size and pback_size parameters

Reported by: gareth.sylvester-bradley@… Owned by: turkanis
Milestone: Boost 1.39.0 Component: iostreams
Version: Boost Development Trunk Severity: Problem
Keywords: Cc: mateusz@…

Description

Documentation for 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  boost/iostreams/detail/push_params.hpp:

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

Attachments

Change History

comment:1 Changed 4 years ago by danieljames

  • Status changed from new to closed
  • Resolution set to fixed

(In [57608]) Hopefully fix #2894.

By Richard Smith

comment:2 Changed 4 years ago by Richard Webb <richard.webb@…>

  • Status changed from closed to reopened
  • Version changed from Boost 1.38.0 to Boost Development Trunk
  • Resolution fixed deleted

It looks like the change to detail/streambuf/indirect_streambuf.hpp has caused a bunch of regression test failures. e.g. from http://www.boost.org/development/tests/trunk/developer/iostreams.html :

From VC10: indirect_streambuf.hpp(171) : error C2782: 'const _Ty &std::max(const _Ty &,const _Ty &)' : template parameter '_Ty' is ambiguous

From GCC 4.4.1: indirect_streambuf.hpp:171: error: no matching function for call to ???max(int, std::streamsize&)??

Changing line 171 of indirect_streambuf.hpp to cast the '2' to a std::streamsize fixes the failures on VC10.

comment:3 Changed 4 years ago by mloskot <mateusz@…>

  • Cc mateusz@… added

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.

comment:4 Changed 4 years ago by Richard Webb <richard.webb@…>

Looks like indirect_streambuf.hpp has been fixed in [57710].

comment:5 Changed 4 years ago by danieljames

  • Status changed from reopened to closed
  • Resolution set to fixed

(In [58633]) Merge iostream fixes, mostly by Richard Smith.

Fixes #3612, #3311, #2094, #3010, #2894, #3011, #3352, #3505.

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.