Closed as not planned
Description
Zig Version
0.10.0-dev.3664+02070ae26
Steps to Reproduce
const Rgb24 = packed struct {
r: u8,
g: u8,
b: u8,
};
test {
try std.testing.expectEqual(@as(usize, 3), @sizeOf(Rgb24));
}
Expected Behavior
The above test should pass.
Some time ago I fixed issues with packed struct in stage1 so that @sizeOf(Rgb24)
would return 3
and if I have pixels: []Rgb24
I could use reader.readAll(std.mem.sliceAsBytes(pixels))
to load tightly packed Rgb24 data.
Actual Behavior
Now in stage2 @sizeOf(Rgb24)
returns 4
and the array also isn't tightly packed but has additional byte of padding for each element which breaks readAll
code.