News for hackers. Stuff that matters.
Re:Undefined behavior in C is a reading error by MauranKilom on Thursday May 20, 2021 @05:49PM (#27227816)
> 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?

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.
Re:Undefined behavior in C is a reading error by pjmlp on Friday May 21, 2021 @04:17AM (#27231638)
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.