Skip to content

C pointer checks alignment with @ptrFromInt #24326

@ypsvlq

Description

@ypsvlq

Zig Version

0.15.0-dev.905+edf785db0

Steps to Reproduce and Observed Behavior

_ = @as([*c]u64, @ptrFromInt(1)); results in error: pointer type '[*c]u64' requires aligned address

_ = @as([*c]u64, 1); builds successfully.

Expected Behavior

Builds successfully.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugObserved behavior contradicts documented or intended behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions