Re:Undefined behavior in C is a reading error
by gpderetta on Thursday May 20, 2021 @06:15PM
(#27228099)
Obviously you wouldn't be able to catch many, or even most cases. Use-after-free is another case that would be very expensive to detect.
I was using it in 2000,
https://www.parasoft.com/products/parasoft-insure/
21 years later it is still an uphill battle to adopt such technology in C and C++ projects.
Modifying a value from a different thread without synchronization is UB. The compiler assumes this does not happen in order to e.g. move things into registers. Could you elaborate how (and how often) you would like to have this kind of UB-derived axiom ("this value remains the same from here to there") checked with assertions?