#error: cast increases pointer alignment

1 messages · Page 1 of 1 (latest)

pure mural
#

How would I force Zig to cast a u8 pointer to uint32_t pointer? I am getting the byte array from C (more specifically, shaderc compile output), and using it in another C struct (VkShaderModuleCreateInfo.pCode which is const uint32_t*)

night turret
#

@ptrCast(*u32, @alignCast(@alignOf(u32), ptr))

spice saffron
#

small nit: probably want [*]u32 instead