3 ms·
> It would be nice for compilers to have an option to automatically introduce assetions whenever they rely on some UB-derived axiom Modifying a value from a d
by MauranKilom 5y ago
> It would be nice for compilers to have an option to automatically introduce assetions whenever they rely on some UB-derived axiom
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?
- gpderetta 5y agoObviously 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.
- pjmlp 5y agoI was using it in 2000, https://www.parasoft.com/products/parasoft-insure/ 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.