Comment Comment by leni536 13. But if the line with UB isn't executed, then the program will work normally as if the UB wasn't there.14. Okay, but if the line with UB is unreachable (dead) code, then it's as if the UB wasn't there.15. If the line with UB is unreachable code, then the program won't crash because of the UB.16. If the line with UB is unreachable code, then the program will at least stop running somehow and at some point.This is nonsense. The line with UB has to be reached for the execution to be undefined. parent leni536 3 years ago
14. Okay, but if the line with UB is unreachable (dead) code, then it's as if the UB wasn't there.
15. If the line with UB is unreachable code, then the program won't crash because of the UB.
16. If the line with UB is unreachable code, then the program will at least stop running somehow and at some point.
This is nonsense. The line with UB has to be reached for the execution to be undefined.