Opened 13 years ago

Closed 13 years ago

#4055 closed Bugs (fixed)

msvc C4244 warning in boost/iostreams/detail/buffer.hpp(151).

Reported by: pluto@… Owned by: Daniel James
Milestone: Boost 1.43.0 Component: iostreams
Version: Boost 1.42.0 Severity: Problem
Keywords: Cc: k.kowaliczek@…

Description

hi,

the boost.iostream compilation with stlport-5.2.1 produces a warning:

boost_1_42_0/boost/iostreams/detail/buffer.hpp(151) : warning C4244: 'argument' : conversion from 'stlp_std::streamsize' to 'stlp_std::allocator<_Tp>::size_type', possible loss of data

the streamsize definition from preprocessed stlport char_traits:

//The Win32 file io API support 64 bits access so streamoff and streamsize
//has to reflect that. Do not change the stringbuf behavior.
typedef __int64 streamoff;

typedef streamoff streamsize;

passing int64 data for size_t argument on win32 doesn't look good.

Change History (3)

comment:1 by Daniel James, 13 years ago

Owner: changed from Jonathan Turkanis to Daniel James
Status: newassigned

I don't think it's going to overflow, since size_ is always set from an int (which probably should be std::size_t, or allocator::size_type but I'm not going to change that, as I don't want to change the interface). But I'll look into fixing the warning.

comment:2 by pluto@…, 13 years ago

you can use an explicit static_cast<std::size_t>(size_) or #pragma warning disable/default.

comment:3 by Daniel James, 13 years ago

Resolution: fixed
Status: assignedclosed

I think this was fixed in [61208].

Note: See TracTickets for help on using tickets.