5 ms·
Specifying that anything can be done in the presence of UB is a poor specification. The word "specify" is pretty much the opposite of "anything." Perhaps compi
by djoldman 5y ago
Specifying that anything can be done in the presence of UB is a poor specification. The word "specify" is pretty much the opposite of "anything."
Perhaps compilers should delete all scopes with UB: much more UB would be purged from code as a result (programmers would be forced to enable compiler errors on UB).
- PeterisP 5y agoCompilers generally do delete all scopes where they can detect that UB is certain (assuming that they can't happen and thus those sections are unreachable code) - but they can't detect and delete all scopes where UB is possible given certain input data, that would contradict the halting theorem and all that.