Skip to content

@bitCast allowed to cast to/from vectors of pointers #18936

@xdBronch

Description

@xdBronch

Zig Version

0.12.0-dev.2711+f995c1b08

Steps to Reproduce and Observed Behavior

test {
    _ = @as(@Vector(1, *u8), @bitCast(@Vector(1, usize){1}));
}

this test passes as well as the inverse operation

Expected Behavior

regular pointers cannot be @bitCasted, instead requiring either @ptrFromInt or @intFromPtr, vectors should behave the same

Metadata

Metadata

Assignees

No one assigned

    Labels

    proposalThis issue suggests modifications. If it also has the "accepted" label then it is planned.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions