The correct rule is that a store which writes an object as a whole initializes it as a whole,
padding included, and that a fill done a member at a time leaves the padding alone. That rule
reports a structure filled member by member and then hashed, compared or written to a file,
and it is right to: that is CWE-200 and it is the kernel infoleak KMSAN was built to find.
It is also every third program in a userspace corpus, where the bytes never leave the process
and nobody is hunting an infoleak. So section 9.3 makes it a flag and splits the default:
padding participates for the kernel profile, where the leak is the thing being looked for, and
does not for library code, where it would be a torrent of reports about programs nobody is
worried about. Document 12’s scoreboard reports the two configurations separately for the same
reason.
-fsafety-init=nopadding. A store through a member says the padding after it holds
something too, so a record filled a member at a time comes out entirely written.