3 ms·
> Accessing the value stored in "value" through the "fields" member is undefined behavior. I’m surprised at that. Can you quote the relevant part of the spec t
by chrisseaton 5y ago
> Accessing the value stored in "value" through the "fields" member is undefined behavior.
I’m surprised at that. Can you quote the relevant part of the spec that you think makes this undefined behaviour?
- CyberRabbi 5y agoIt's undefined behavior in C++. In C it is not certain if it is undefined or unspecified behavior. https://stackoverflow.com/questions/11373203/accessing-inactive-union-member-and-undefined-behavior https://stackoverflow.com/questions/11373203/accessing-inact...
- chrisseaton 5y agoI think the standard and the link you've giving makes it pretty explicit that it's unspecified. I don't really see where you can get undefined from?