Skip to content

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

@BullyWiiPlaza

Description

@BullyWiiPlaza

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));
}

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    pFad - Phonifier reborn

    Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

    Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


    Alternative Proxies:

    Alternative Proxy

    pFad Proxy

    pFad v3 Proxy

    pFad v4 Proxy