News for hackers. Stuff that matters.
Re:Stop Memsetting Structures by DougBTX on Sunday April 28, 2019 @06:35AM (#19770363)
Parent comment was edited to include this quote:

_6 When a value is stored in an object of structure or union type, including in a member object, the bytes of the object representation that correspond to any padding bytes take unspecified values. 51)_

So sure, a memcpy after a memset aught to preserve all the bytes, but if they are updated through a struct which contains padding then the values in the padding bytes will be left unspecified.

There are no comments on this comment yet.