← board

C struct field designators .field = v in braced initializers

Cases

Symptom

Field values assigned in declaration order; the .field designator is ignored, so { .b = 2, .a = 1 } writes a=2, b=1.

Fix (both paths — a "current field index" cursor)

Before reading each element value, if the token stream is . ident =, resolve the field with FindUField(recId, name) and set the running fldI to it (then consume . ident =); otherwise keep the sequential fldI. After each element, fldI advances by one (C 6.7.8: a designator repositions, then filling continues from there).

Gate

00048/00049 exit 0; drop them from test/c-conformance/pxx.skip; add a regression test; make test + self-host byte-identical.

Log