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

Integral constant overflow #3274

Closed
albert-github opened this issue Jan 15, 2023 · 3 comments
Closed

Integral constant overflow #3274

albert-github opened this issue Jan 15, 2023 · 3 comments

Comments

@albert-github
Copy link

fmt/include/fmt/format-inl.h

Lines 1146 to 1147 in 0f42c17

const uint32_t mod_inv_5 = 0xcccccccd;
const uint32_t mod_inv_25 = mod_inv_5 * mod_inv_5;

In the spdlog project (see issue gabime/spdlog#2607) I got the warning messages:

...\deps\spdlog\include\spdlog\fmt\bundled\format-inl.h(1154): warning C4307: '*': integral constant overflow
...\deps\spdlog\include\spdlog\fmt\bundled\format-inl.h(1186): warning C4307: '*': integral constant overflow
...\deps\spdlog\include\spdlog\fmt\bundled\format-inl.h(1207): warning C4307: '*': integral constant overflow

and I was referred to this project.
Line numbers are a little bit different (probably a slightly other version)

@albert-github albert-github changed the title Integral constatnt overflow Integral constant overflow Jan 15, 2023
@jk-jeon
Copy link
Contributor

jk-jeon commented Jan 16, 2023

I think this is a duplicate of this: #3163

@albert-github
Copy link
Author

It is a duplicate, but it is quite annoying, so it would be good when in fmtlib the code was modified (e.g. a cast) so that the warning disappears.

@vitaut
Copy link
Contributor

vitaut commented Jan 25, 2023

This is an MSVC bug which is worked around in a2c05a1.

@vitaut vitaut closed this as completed Jan 25, 2023
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

3 participants