- Undefined behavior in C refers to code situations where the standard does not define the result. According to the source, this is a problem because compilers may perform optimizations that differ from what programmers expect based on it.
- The speaker, Martin Uecker, explained that the C23 standard added a 'no time travel' clause to prevent time-travel-style optimizations. He also said that about 100 of the standard's undefined behaviors were removed in the C2y draft, with 45 of them removed.
- According to the talk, tools for checking code are increasing, including compiler warnings, static analyzers, sanitizers, and formal verification. Memory safety is addressed in three parts: types, space, and time. The speaker's view is that full guarantees require expensive runtime checks or formal verification.
- The source gives an example of splitting it into 0, showing that an optimization that removes a check before a division is allowed in some cases but wrong in others. This is because a function call in between changes the program's behavior.
The example that divides by 0 caught my eye, where the check can be removed entirely. It is also interesting that the same code becomes an incorrect optimization once a single function call is added. From the article alone, it is hard to tell when the removal of 45 undefined behaviors from the C2y draft will actually show up in real compiler behavior.