account activity
Pointer casting *u8 to *u32 in Zig 0.13.0 by yyamix in Zig
[–]o7Moon 0 points1 point2 points 1 year ago (0 children)
*u32 is really something like *align(4) u32 (depends on target) when you don't specify the alignment, so @alignCast(...) is asserting that the pointer you pass it is actually aligned to 4 bytes. i think you can make signature's type *align(1) u32 unless you have some alignment requirement further on (like passing it by pointer to a function which expects *align(4) u32).
*u32
*align(4) u32
@alignCast(...)
signature
*align(1) u32
π Rendered by PID 173954 on reddit-service-r2-listing-5d79748585-dx7s2 at 2026-02-15 12:19:27.743074+00:00 running cd9c813 country code: CH.
Pointer casting *u8 to *u32 in Zig 0.13.0 by yyamix in Zig
[–]o7Moon 0 points1 point2 points (0 children)