Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

boost\network\uri\uri.hpp(336,40): warning C4244: 'argument': conversion from '__int64' to 'long', possible loss of data #896

Open
BullyWiiPlaza opened this issue Nov 6, 2021 · 1 comment
Assignees

Comments

@BullyWiiPlaza
Copy link

Hi, I'm using vcpkg and when I include cpp-netlib in my codebase, I always get the following compilation warning:

C:\vcpkg\installed\x64-windows-static\include\boost\network\uri\uri.hpp(336,40): warning C4244: 'argument': conversion from '__int64' to 'long', possible loss of data (compiling source file main.cpp)

This would easily be fixed by adding a respective cast in this library:

inline bool operator==(const uri &lhs, const uri::value_type *rhs) {
  auto rlen = std::strlen(rhs);
  size_t llen = std::labs((long) std::distance(lhs.begin(), lhs.end())); // <---
  if (rlen != llen) return false;
  return boost::equal(lhs, boost::make_iterator_range(rhs, rhs + rlen));
}
@BullyWiiPlaza
Copy link
Author

Is this issue getting noticed at all?
It's still not resolved in Boost version 1.78.0 and it would be so simple...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants