Open Laeeth opened 5 years ago
What would this accomplish?
Why wouldn't you convey the information to the user?
If you have a type T that is a char it might take up 8 bytes with padding. But so might a static array of 8 of the T. So isn't it something important?
You need to know on the other side how big the thing is.
Do you mean that dpp should emit structs with explicit padding in case the D and C++ compilers disagree on how much padding there is? That sounds possible in theory but I don't think it happens in practice.
If you make types opaque then you should distinguish between actual size of the type and the padding.
It's not because of disagreement but because of static arrays
Static arrays aren't any more or less special than other fields - what the other side needs to know is how many bytes it takes up, alignment included.
Dpp should represent the padding as a private ubyte[n] padding3__ and the padding should not be part of the type blob itself.