3 ms·
Mostly because C structs have a very exactly bound memory representation, and padding bytes are just about the only thing you can - mostly - get away with not c
by eqvinox 6y ago
Mostly because C structs have a very exactly bound memory representation, and padding bytes are just about the only thing you can - mostly - get away with not caring about.
Coincidentally, even padding bytes break things technically. Since they're undefined, you - in theory - can't ever calculate a bytewise hash value over a struct that has any padding bytes. It's still done frequently, it's just nulled out beforehand and copying is bytewise anyway. Doesn't change the fact that to the spec letter it's undefined behaviour. GCC also added __builtin_clear_padding() recently.
Hidden tags ... no. Just no.
- nicoburns 6y agoDoesn't need to be hidden. Just usable with language features (e.g. pattern matching) without accessing it explicitly.