It also helps if you only append to the end of the struct for newer fields.
The version could be useful if some members change their meaning across versions. But this would mean that you couldn't use a struct made from a future version because you wouldn't know about potentially changes.
Personally, I have only seen version or size, but not both. Do you have an example?
> It also helps if you only append to the end of the struct for newer fields.
This is actually required because changing or reordering existing members is an ABI break. Unless every version has its own dedicated struct. (This is often done in COM like APIs where interfaces are extended by adding a new interface. The client queries the must recent interface it knows about; if not supported, it tries the previous interface, and so on until it succeeds.)
If you have structs that might need to be extended, you can use "versioned structs". One popular technique is to include the struct size as the first field. The struct size is set to `offsetof(mystruct, lastmember) + sizeof(lastmember)` and the receiver of the struct can use this to check if a member exists. The ARA API is a good example: https://github.com/Celemony/ARA_API/blob/65ec5c43b943a48cb54...