4 ms·
> However the problem isn't just that compilers ignore UB, they actively make use of it! I think this might depend on how you interpret the standard and/or com
by aw1621107 6y ago
> However the problem isn't just that compilers ignore UB, they actively make use of it!
I think this might depend on how you interpret the standard and/or compiler's actions.
If you believe "ignoring the situation completely" means "ignore precisely those statements that invoke UB and leave everything else intact", then the transformations done by compilers can look like actively taking advantage of UB beyond what might be implied by the standard.
If you think "ignoring the situation completely" allows "inspect the set of program executions, discard those in which UB is invoked, and optimize based on the remaining possible executions", then the mere act of "ignoring UB" can't really be distinguished from "actively making use of UB"; the actions are one and the same.