5 ms·
What you're missing is that storing to an object doesn't "access it's stored value". Once you've stored to the malloced memory through an int-typed lvalue, it'
by caf 11y ago
What you're missing is that storing to an object doesn't "access it's stored value".
Once you've stored to the malloced memory through an int-typed lvalue, it's effective type becomes int, and you can't access it (ie. read it) through a double-typed lvalue. But you can then write to it through a double-typed lvalue, because that doesn't access it's stored value - it overwrites it, and changes its effective type to double.
- sharpneli 11y agoThe specification defines the word "access" as: access 〈execution-time action〉 to read or modify the value of an object I would interpret that so that writing does modify the value.