Closed svigerske closed 5 years ago
Comment by @tkralphs created at 2015-01-06 19:06:44
This implementation seems to be from an old version of CoinUtils. I can't discern which one. The current version has a different implementation, which looks to me like it shoud work.
std::ptrdiff_t offset = temp - reinterpret_cast<char *> (rhs.message_);
Comment by @tkralphs created at 2015-01-06 19:06:44
Resolution: invalid
Issue created by migration from Trac.
Original creator: wxBen
Original creation time: 2014-12-13 00:05:01
Version:
In CoinMessageHandler.cpp, there are three instance of code that uses "long offset" as in:
Visual C++ 64-bit treats "long int" as four bytes, but pointers are eight bytes of course. Stupid, I know. But it makes it crash. So my quick fox for this is as follows:
So my request is, please fix the three instances in this file to be more portable. Perhaps rather than test for _WIN64 which may be MS specific, you can use size_t (which is eight bytes under 64-bit VSS). Or rewrite that code to not do pointer arithmetic using longs.
This is sadly a problem that plagues a lot of software, so sqlite for example, has a header file that tests and defines types accordingly, for example: