3 ms·
> that will zero any padding too and end up just doing the right thing No, it will not; the compiler can and occasionally will transform this into two writes t
by saagarjha 7y ago
> that will zero any padding too and end up just doing the right thing
No, it will not; the compiler can and occasionally will transform this into two writes that don't touch padding. It is surprisingly difficult to actually zero out padding bits. (However, your code is better than the one mentioned above, as it does correctly zero out the structure's members.)