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

sry i dont know how to reopen > warning C4307: “*” on VS2017 #3163 #3211

Closed
Qujamlee opened this issue Nov 29, 2022 · 1 comment
Closed

Comments

@Qujamlee
Copy link

    > I wasn't able to reproduce this in https://godbolt.org/z/baaGbjebz. Please provide more repro details.

There is indeed this problem, and I have reproduced it on the website you provided, but you need to choose x64msvc19.22 and earlier versions of the compiler.I copied the warning message:

x64 msvc v19.22 /std:c++latest /W2
Compiler stdout
example.cpp

(5): warning C4307: '*': integral constant overflow Program returned: 0

But using newer versions of the compiler does not have this warning. Why? Did the compiler do the optimization?
I'm doing the math,
const uint32_t mod_inv_5 = 0xcccccccd = 3_435_973_837 (decimal),
the square of it is 11_805_916_208_548_502_569,
It does exceed the maximum range of uint32_t (4_294_967_295) ,
so the warning message seems reasonable, is it a bug?

Originally posted by @Qujamlee in #3163 (comment)

@vitaut
Copy link
Contributor

vitaut commented Nov 30, 2022

For future reference: commenting on the original issue is enough, no need to open a duplicate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants