Re:The Lost Art of Structure Packing (2018)
by saagarjha on Tuesday April 28, 2020 @01:19AM
(#23003660)
…and assigning to a variable is supposed to put some bytes at a certain address, yes. Except compilers will skip doing so if you never read from the variable again, and the same thing happens here: the compiler can "know" that it has no need to actually do the assignment, as writing to padding bytes is not required to actually do anything and trying to observe the value is currently the subject of debate but somewhere between "undefined" and "whatever you get out of it has nothing to do with what you think went in".
[ Parent
| on HN ]
There are no comments on this comment yet.