[Boost-bugs] [Boost C++ Libraries] #7504: boost::interprocess::basic_vectorbuf calls std::char_traits<char>::pbump() with potentially mismatching data type

Subject: [Boost-bugs] [Boost C++ Libraries] #7504: boost::interprocess::basic_vectorbuf calls std::char_traits<char>::pbump() with potentially mismatching data type
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-10-14 22:57:17


#7504: boost::interprocess::basic_vectorbuf calls std::char_traits<char>::pbump()
with potentially mismatching data type
-----------------------------------------+----------------------------------
 Reporter: mbradshaw@… | Owner: igaztanaga
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: interprocess
  Version: Boost 1.52.0 | Severity: Problem
 Keywords: |
-----------------------------------------+----------------------------------
 `boost::interprocess::basic_vectorbuf::seekoff()` makes a call to
 `base_t::pbump()`, but the datatypes (may) mismatch for the parameter (and
 do on my system). `std::char_traits<char>::pbump()` takes an `int`
 (according to the standard), but `basic_vectorbuf()` is passing it a value
 of type `CharTraits::off_type`, which is implementation defined. Since
 `std::char_traits<char>::off_type` is `__int64` on my system, I am getting
 a warning about a conversion from `__int64` to `int`.

 I don't know what the most appropriate solution is (maybe just a
 `static_cast`), but it would be nice to have this resolved so I can get
 back down to 0 warnings in my codebase.

 I am using Visual Studio 2010 and the latest Boost (and I just check svn
 trunk and it has the same issue). I get this warning when creating a
 `boost::interprocess::basic_vectorstream` like so:

 `basic_vectorstream<std::vector<char>, std::char_traits<char>> vs;`

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/7504>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:10 UTC