Memory-safe C code
Memory-safe C code
Posted Nov 16, 2025 18:37 UTC (Sun) by khim (subscriber, #9252)In reply to: Memory-safe C code by alx.manpages
Parent article: Rust in Android: move fast and fix things (Google Security Blog)
> That wouldn't be minor, and we're not far from such a thing in C.
Anything that doesn't handle memory allocations would be “a minor thing”. That's why Ada was such a big thing in some [limited] places (like embedded firmware) and ho-hum event in the majority of places: when you may live without dynamic memory allocations Ada works great, where you couldn't… it's not much better than C. At least that's how it worked for a few decades.
It eventually got pointers handled (by borrowing ideas from Rust, of course), but at this point it was too late.
> Then, there would be some more work needed to make it perfectly safe, but with that part, you could already write much better code.That would be a good thing, definitely… but to achieve similar reduction in the bug rate you need to handle memory allocations, somehow.
That's the biggest problem and biggest pay-off.
