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

Try to suppress MVSC warn of narrowing #2230

Merged
merged 4 commits into from
Apr 13, 2021
Merged

Conversation

denchat
Copy link
Contributor

@denchat denchat commented Apr 13, 2021

Try to suppress MVSC warn of narrowing at

fmt\test\format-test.cc(774): warning C4838: conversion from 'int' to 'wchar_t' requires a narrowing conversion

denchat added 3 commits April 13, 2021 12:01
Try to suppress MVSC warn of narrowing

> fmt\test\format-test.cc(774): warning C4838: conversion from 'int' to 'wchar_t' requires a narrowing conversion
and change the mask target into unsigned int

Note:  This is odd because the `std::make_unsigned_t` is supposed to bethere in c++14.
'+' | (1 << fmt::detail::num_bits<char>()), L'}', 0};
'+' | static_cast<wchar_t>(
1 << fmt::detail::num_bits<char>()
& static_cast<typename std::make_unsigned<int>::type >(-1) ),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The second static cast and & are not needed, please remove.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May I ask if it's unneccessary always or just in this case?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see why it was added in the first place here. It has no effect.

@vitaut vitaut merged commit 24c9751 into fmtlib:master Apr 13, 2021
@vitaut
Copy link
Contributor

vitaut commented Apr 13, 2021

Thanks

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 this pull request may close these issues.

2 participants