3 ms·
While I agree with your essential point about #1, I think we agree for different reasons. UBSan is a set of run-time checks and has low compile-time cost. The
by jbapple 10y ago
While I agree with your essential point about #1, I think we agree for different reasons.
UBSan is a set of run-time checks and has low compile-time cost. The example function you give, f, would be complained about if you passed it INT_MAX, but that complaint would come at run-time and it would never be triggered if you never passed it INT_MAX.
I also agree that it is not possible to enforce non-INT_MAX limits, like x < 10.
- kentonv 10y agoOh, for some reason I thought Clang's sanitizers were strictly compile-time, but looking closer I see that's not correct. Hmm, will have to look closer at that.