Skip to content

Weird bits shifting behavior on win32 #16249

@tomaka

Description

@tomaka

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions