Skip to content

Fix *(reinterpret_cast<unsigned int*>(&block)) = idx; dereferencing type-punned pointer will break strict-aliasing rules #68

@pbelevich

Description

@pbelevich
       *(reinterpret_cast<unsigned int*>(&block)) = idx;
  ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pytorch/csprng/torchcsprng/csrc/csprng.h:74:2: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions