4 ms·
Um, sounds like the most appropriate response would be a low-performance C compiler/interpreter that enforces crashes on all run-time undefined behaviors, and r
by Pxtl 11y ago
Um, sounds like the most appropriate response would be a low-performance C compiler/interpreter that enforces crashes on all run-time undefined behaviors, and refuses to compile for any compile-time checkable ones.
- kenko 11y agoWhy is that more appropriate than just defining all the currently undefined/implementation-specific behavior?
- Pxtl 11y agoBecause enforcing undefined behavior on this test-compiler means you can build your software on any standards-compliant compiler and have it work the same. In theory.
- CountSessine 11y agoIMO both approaches would be useful. One nice thing about outlawing undefined behaviour rather than defining it, though, it that you'll be writing portable code - if you have a code base that's filled with all all sorts of once-was-undefined-but-now-is-defined behaviour, you can never build that code on another compiler.
- deleted 11y ago[deleted]
- nwmcsween 11y agoUbsan already does this, there is a flag that controls abort on UB.
- pekk 11y agoUnfortunately, nobody will use that compiler. They will continue to use the high-performance compilers, because this is what happened decades ago.