@spun_off so I was thinking about the benefits of UB for bug indication and concluded there is none
Huh? I think there's a big gap in your reasoning, or I misunderstood you. Got an example case?
-
-
the argument that without ub there would be no ubsan, and thus no bugs exposed by ubsan through ub
-
you could get the equivalent of ubsan's bug-finding power using basically a "use strict"; for C
-
Then I think you're wrong. The behavior being undefined, or at least unspecified, is what gives you that choice.
-
If it's well-defined, then programs doing it are valid, have specified behavior, and impls must match that behavior.
-
And if the mandated behavior is trapping/aborting, you need very expensive runtime checks all over.
-
Checking for OOB accesses, aliasing errors, double free, etc. with full accuracy is NOT easy or cheap.
-
you can permit BOTH.
-
UB _is_ the formal model for permitting both. Are you just objecting to the name "UB"?
- 4 more replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.