3 ms·
I didn't see anything new either. What I would expect from C developers is this: * Run all CI with UBSAN. Create versions of popular distributions that build
by imtringued 2y ago
I didn't see anything new either.
What I would expect from C developers is this:
* Run all CI with UBSAN. Create versions of popular distributions that build every single package with UBSAN just to catch the bugs.
* Use design by contract patterns for pre and postconditions (library induced UB is popular in C++)
* Use model checking software like CBMC to statically guarantee the absence of UB and validity of the contracts
* Build a fuzzer for every method that cannot be formally verified
This is the bare minimum needed to keep C/C++ safe. The same applies to unsafe Rust by the way.
- cryptonector 2y agoI'd expect something like a super-C that provides a counted-byte string (still NUL-terminated for interoperability) type and support functions, `defer` or similar, `with`-like macros, etc., `mutable`/`immutable`. Such a thing could be like C++ was in the beginning: a front-end that translates to C99 or whatever standard is your lowest common denominator. You'd still have to do manual memory management, so you'd still have use-after-free issues, but they'd be a lot less common. Similarly you'd still have races, but a lot fewer.