News for hackers. Stuff that matters.
Re:Stop Memsetting Structures by Someone on Saturday April 27, 2019 @03:54PM (#19767306)
That doesn’t check whether that memset call writes 0xFF bytes in the padding.

The compiler could also determine that &a.x)[1] is undefined behavior in C (reading past the end of an object), and take advantage of that.

The way to check that is by disassembling the code, and even that doesn’t say what a C compiler should do, only what these particular compilers do.

Re:Stop Memsetting Structures by mehrdadn on Saturday April 27, 2019 @04:08PM (#19767360)
I feel like you're missing the point (the gcc -O0 was there for a reason) but I updated it. Is this better?