parse,check,type,wwi: @packed struct attribute, both stages (#51)
Hare/harec @packed struct layout: no inter-field or trailing padding, align =
max field align (NOT forced to 1) — matches harec type_store.c + types.c:621
(packed{u8,u64}=size 9/align 8). Parser consumes inline @packed (loud-rejects
unknown struct attrs, both stages); layout gates padding on !packed; cstage
type_eq enforces packed type-distinctness; the .wwi producer round-trips
"struct @packed {". wwstage sets slotsize=size for packed so its composite-ABI
copy matches cstage byte-for-byte. cstage identity is faithful; wwstage identity
rides the deferred #224 nominal-resolvealias arc (#108). Both stages byte-id;
447 tests pass.
This commit is contained in:
@@ -267,6 +267,9 @@ type_eq(Type *a, Type *b)
|
||||
return pa == NULL && pb == NULL;
|
||||
}
|
||||
case TY_STRUCT: {
|
||||
/* packed is part of struct identity: a packed struct is
|
||||
* not equal to its unpacked twin (harec types.c:621). */
|
||||
if (a->packed != b->packed) return 0;
|
||||
Tfield *fa = a->fields, *fb = b->fields;
|
||||
while (fa && fb) {
|
||||
if (strcmp(fa->name, fb->name) != 0) return 0;
|
||||
|
||||
Reference in New Issue
Block a user