5 ms·
Is padding specified by the spec? Because if it's not then padding won't help you either since you don't know that your padding aligns with the compiler's. Rath
by asiachick 6y ago
Is padding specified by the spec? Because if it's not then padding won't help you either since you don't know that your padding aligns with the compiler's. Rather AFAIK you need to write some compile time checks that what you think the compiler is going to do is what it does and fail compilation if doesn't and then add whatever compiler/platform/option specific code to get your stuff to match along with more tests.
- nwmcsween 6y agoYou would match by adding explicit padding bytes which would be archish specific (32 bit vs 64bit). A much better alternative to making life hard though is to just manually pack the struct