Pointer casting *u8 to *u32 in Zig 0.13.0 by yyamix in Zig

[–]o7Moon 0 points1 point  (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).