3 ms·
I don't think I got any of it wrong, but in case I did I'd appreciate if you could point out my mistake(s). :)
by ralfjung 7y ago
I don't think I got any of it wrong, but in case I did I'd appreciate if you could point out my mistake(s). :)
- saagarjha 7y agoI talked a bit about it here: https://news.ycombinator.com/item?id=20435309 https://news.ycombinator.com/item?id=20435309. Basically, the compiler has no need to do things like perform reads in the face of undefined behavior: it could output an empty executable if it wished. Maybe your specific version of the compiler does, but that doesn't mean others (or even a future version of yours) will. Trying to figure out what a compiler might do in the face of undefined behavior is generally not a worthwhile exercise.
- ralfjung 7y ago> Trying to figure out what a compiler might do in the face of undefined behavior is generally not a worthwhile exercise. That is exactly the point of my post! If you think I disagree with that statement, we seriously miscommunicated somewhere. The parts you seem to be concerned about are those where I try to explain why the abstract machine is the way it is. Hardware and compiler concerns do come in at that point, and my feeling is just dogmatically giving an abstract machine won't help convince people of its usefulness.