Opened 14 years ago

#2522 new Bugs

iostreams/stream_offset_64bit_test fails on QNX 6.4.0

Reported by: Niklas Angare <li51ckf02@…> Owned by: Jonathan Turkanis
Milestone: Boost 1.38.0 Component: iostreams
Version: Boost Development Trunk Severity: Problem
Keywords: Cc:

Description

...with the Dinkumware 5 library.

It fails on the first iteration and reports this:

  • sizeof(fpos_t) = 16
  • sizeof(streamoff) = 4
  • sizeof(stream_offset) = 8

...

The constructor of std::streampos (fpos<_Mbstatet>) puts the value in a streamoff so the most significant 32 bits get chopped off.

Defining BOOST_IOSTREAMS_HAS_DINKUMWARE_FPOS results in this:
positioning.hpp: In function 'std::streampos boost::iostreams::offset_to_position(boost::iostreams::stream_offset)':
positioning.hpp:52: error: no matching function for call to 'std::fpos<_Mbstatet>::fpos(std::mbstate_t, boost::iostreams::stream_offset&)'
iosfwd:32: note: candidates are: std::fpos<_Statetype>::fpos(_Statetype, std::fpos_t) [with _Statetype = _Mbstatet]
iosfwd:27: note: std::fpos<_Statetype>::fpos(std::streamoff) [with _Statetype = _Mbstatet]
iosfwd:23: note: std::fpos<_Mbstatet>::fpos(const std::fpos<_Mbstatet>&)

std::fpos_t is defined like this:
struct _Fpost {

_Off64t _Off;
_Mbstatet _Wstate;

}

I wrote this simple test:
std::fpos_t fpos = { 100000000000LL, std::mbstate_t() };
std::streampos pos(std::mbstate_t(), fpos);
std::cout << _FPOSOFF(pos.seekpos()) << std::endl;

It prints 100 billion. Is there a better way to initialize fpos_t? I'm not sure it's correct to use the default value for mbstate_t but offset_to_position() currently does it.

Change History (0)

Note: See TracTickets for help on using tickets.