id summary reporter owner description type status milestone component version severity resolution keywords cc 3969 position_to_offset() is broken for Microsoft Visual C++/Dinkumware gareth.sylvester-bradley@… Daniel James "I have found a bug in position_to_offset() on Microsoft Visual C++/Dinkumware demonstrated by the following test app – {{{ #include #include int main( int, char*[] ) { const boost::int64_t twoGB = 2 << 30; std::streampos pos = boost::iostreams::offset_to_position( twoGB ); pos -= 2; if ( twoGB - 2 != boost::iostreams::position_to_offset( pos ) ) { std::cout << ""Failed!"" << std::endl; return -1; } return 0; } }}} This is resolved by the following patch to boost/iostreams/positioning.hpp. {{{ 105,106c105,106 < static_cast(static_cast(pos)) - < static_cast(_FPOSOFF(streampos_to_fpos_t(pos))); --- > static_cast(static_cast(pos) - > _FPOSOFF(streampos_to_fpos_t(pos))); }}} This has the potential to affect many parts of Boost.Iostreams but in particular it means the ""small seeks optimization"" in indirect_streambuf.hpp is broken. " Patches closed Boost 1.43.0 iostreams Boost 1.42.0 Problem fixed