Commit d7d50496d9

Andrew Kelley <andrew@ziglang.org>
2025-09-10 11:08:11
langref: don't assume too much about pointer to packed struct field
1 parent 725dec6
Changed files (1)
doc/langref/test_overaligned_packed_struct.zig
@@ -8,7 +8,7 @@ const S = packed struct {
 test "overaligned pointer to packed struct" {
     var foo: S align(4) = .{ .a = 1, .b = 2 };
     const ptr: *align(4) S = &foo;
-    const ptr_to_b: *u32 = &ptr.b;
+    const ptr_to_b = &ptr.b;
     try expect(ptr_to_b.* == 2);
 }