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

BUG in platform.h #83

Open
UnePierre opened this issue Jun 26, 2020 · 0 comments
Open

BUG in platform.h #83

UnePierre opened this issue Jun 26, 2020 · 0 comments

Comments

@UnePierre
Copy link

UnePierre commented Jun 26, 2020

Hi!

There is a compiler warning:

C:\Users\fergerm\github.com\aappleby\smhasher\src\Platform.h: In function 'long long unsigned int rdtsc()':
C:\Users\fergerm\github.com\aappleby\smhasher\src\Platform.h:78:52: warning: left shift count >= width of type [-Wshift-count-overflow]
     return (unsigned long)a | ((unsigned long)d << 32);
                                                    ^~

I agree with the analysis, that this looses information!

Fix:

#file platform.h
#line 78
--    return (unsigned long)a | ((unsigned long)d << 32);
++    return (unsigned long long)a | ((unsigned long long)d << 32);
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

1 participant