Manu343726 / ctti

Compile Time Type Information for C++
MIT License
570 stars 55 forks source link

Building example_main in VS2015 causes ctti\examples\main.cpp(24): warning C4307: '*': integral constant overflow #24

Open williamleong opened 6 years ago

williamleong commented 6 years ago

The warning appears for every line of code in VS2015 (but not clang) that results in a call to fnv1a_hash from hash.hpp.

It appears to be a problem specific to VS2015 with the way the 64 bit fnv1a hash is calculated, but implementing the function mulu64 in the solution by "Cheers and hth. - Alf" in https://stackoverflow.com/questions/37658794/integer-constant-overflow-warning-in-constexpr appears to stop the warning without resorting to setting pragma warnings. Have checked a couple of examples and the hash value generated appears to be the same.