4 ms·
Undefined padding and alignment.
by cantrecallmypwd 2y ago
Undefined padding and alignment.
- Keyframe 2y agoyou can do explicit padding and you can force alignment; latter might be compiler specific until C11 at least. You can always check for the struct layout as an assert.. it's doable.
- atiedebee 2y agoThat doesn't really matter for sum types as used in this blog, does it? As long as you're not serialising the struct or accessing it through pointers of different types it ought to work anywhere.