> The C compiler could hypothetically re-order struct elements, I think.
No, that's one of the things a C compiler can not do, and thank the standard committee. Writing wire data formats in headers is frustrating enough because of implementation-defined padding/alignment already (Pascal had standard PACKED for almost 50 years already, and yet in C __packed and __attribute__((packed)) are still non-standard), imagine how horrible it would be with reordering allowed!
No, that's one of the things a C compiler can not do, and thank the standard committee. Writing wire data formats in headers is frustrating enough because of implementation-defined padding/alignment already (Pascal had standard PACKED for almost 50 years already, and yet in C __packed and __attribute__((packed)) are still non-standard), imagine how horrible it would be with reordering allowed!