News for hackers. Stuff that matters.
Re:Depressing and faintly terrifying days for the C standard... by caf on Wednesday May 30, 2018 @10:11PM (#17193454)
The padding has unspecified values, which is distinct from being uninitialised.

If it were otherwise, you couldn't `memcpy()` structures around.

Re:Depressing and faintly terrifying days for the C standard... by loup-vaillant on Thursday May 31, 2018 @04:25AM (#17194832)
I believe there's an exception for the likes of `memcpy()`. Something along the lines of "type punning and reading indeterminate values is undefined except when we're reading through a `char*` or something.

I'll check the unbelievably thick book that tries to specify C11 (I've printed it, it's over 2 pounds).

Re:Depressing and faintly terrifying days for the C standard... by caf on Thursday May 31, 2018 @08:56PM (#17201684)
The only way to access the padding without otherwise falling into undefined behaviour is by using a char * anyway (including indirectly using a char *, through memcpy()).