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

Weird bits shifting behavior on win32 #16249

Closed
tomaka opened this issue Aug 4, 2014 · 0 comments
Closed

Weird bits shifting behavior on win32 #16249

tomaka opened this issue Aug 4, 2014 · 0 comments

Comments

@tomaka
Copy link
Contributor

tomaka commented Aug 4, 2014

This is a win32-only issue.

On windows 64 bits:
(8u * std::mem::size_of::<u32>()) returns 32
3u >> (8u * std::mem::size_of::<u32>()) returns 3
3u >> 32u returns 0

EDIT: IRC found the problem, uint is only 32 bits even on Windows 64 bits, which causes undefined behavior.
Sorry for wasting your time, closing.

@tomaka tomaka closed this as completed Aug 4, 2014
bors added a commit to rust-lang-ci/rust that referenced this issue Jan 8, 2024
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