Opened 8 years ago

#11033 new Bugs

boost::iostreams::copy: conversion from 'std::streamsize' to 'int'

Reported by: polkovnikov.ph@… Owned by: Jonathan Turkanis
Milestone: To Be Determined Component: iostreams
Version: Boost 1.55.0 Severity: Problem
Keywords: Cc:

Description

When using <boost/iostreams/copy.hpp> in VS 2013 Update 2, I've got

boost\iostreams\copy.hpp(128): warning C4244: 'argument' : conversion from 'std::streamsize' to 'int', possible loss of data

I'm passing ifstream through copy to Poco SHA1, and the files are more than 2 GB long. It is not easy to tell if hashes for the files are correct, but from source code it seems that they are not.

The strange row "size_(buffer_size) Cast for SunPro 5.3." looks like it was made deliberately to fix some other bug.

Trying to hotfix this bug I run into a problem, that the type should be std::streamsize and std::size_t simultaneosly. size_t is required by std::allocator::allocate. I've found similar problem here:

https://svn.boost.org/trac/boost/ticket/7873

Unfortunately I don't understand the code well enough to workaround that allocator parameter issue.

Change History (0)

Note: See TracTickets for help on using tickets.