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

MSVC warning C4365: signed/unsigned mismatch in cxx.cc operator<< overloads #1225

Closed
wravery opened this issue Jun 14, 2023 · 0 comments
Closed

Comments

@wravery
Copy link
Contributor

wravery commented Jun 14, 2023

After a recent compiler upgrade on Windows, I started seeing a warning that there's a signed/unsigned mismatch in cxx.cc:

std::ostream &operator<<(std::ostream &os, const String &s) {
  os.write(s.data(), s.size());
  return os;
}

The s.size() method returns std::size_t, but os.write takes a signed std::streamsize

I think the same probably applies to the equivalent Str operator below that, but in my case the warning was treated as an error, and it seems to have stopped compilation rather than reporting that one.

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

1 participant