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

warning C4800 emitted for fmtlib 10.0.0 #3444

Closed
adesitter opened this issue May 16, 2023 · 3 comments · Fixed by #3446
Closed

warning C4800 emitted for fmtlib 10.0.0 #3444

adesitter opened this issue May 16, 2023 · 3 comments · Fixed by #3446

Comments

@adesitter
Copy link
Contributor

When building
return WriteConsoleW(reinterpret_cast<void*>(_get_osfhandle(fd)), u16.c_str(),
static_cast<uint32_t>(u16.size()), &written, nullptr);

Visual Studio 2019 with suitable warning emits:

fmt\include\fmt\format-inl.h(1460,23): warning C4800: Implicit conversion from 'int' to bool. Possible information loss

return WriteConsoleW(reinterpret_cast<void*>(_get_osfhandle(fd)), u16.c_str(),
static_cast<uint32_t>(u16.size()), &written, nullptr) != 0;
would fix it.

@vitaut
Copy link
Contributor

vitaut commented May 17, 2023

Could you submit a PR?

@msmolensky
Copy link

It is a different issue:

fmt/format.h(1055,56): warning C4275: non dll-interface class 'std::runtime_error' used as base for dll-interface class 'fmt::v10::format_error'

In v 10.0.0, FMT_CLASS_API macro is missing in core.h (lines 191 and 197) and in format.h (line 1055) which causes the above warning in MSVC

@vitaut
Copy link
Contributor

vitaut commented May 26, 2023

As already commented elsewhere:

Looks the same as #3444. If it's a different issue please provide a godbolt repro.

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

Successfully merging a pull request may close this issue.

3 participants