3 ms·
Suppose the program does UB only when run it with an argument longer than 3 characters, but you never run it that way. It's OK.
by souprock 6y ago
Suppose the program does UB only when run it with an argument longer than 3 characters, but you never run it that way. It's OK.
- BenFrantzDale 6y agoI understand that it has to be OK for functions to invoke UB if their preconditions aren’t met. And I guess you could have a pointer to this function and thereby want it to exist without ever invoking UB. But to me a function that can’t be called without UB really should be a compile error. I’m trying to think of counterexamples...