> with no evidence of memory corruption over a span of 30 years.
How many people did you had on those teams and how was the development process?
Me too I have written such software, when working in teams of no more than two people where we taken a Pascal like approach to programming in C.
Basically:
- Use translation units as modules
- structs are always exposed as Abstract Data Types, with accessors either via macros (when speed matters) or functions
- assert everywhere any assumption that can lead to memory corruption
- on debug code, make use of assert with pointer validation library from debugger, e.g. IsBadReadPtr()
- arrays are never accessed with pointer syntax
- use of compiler extensions for bound checking during debug builds
- all warnings enabled and considered as errors
And quite a few others.
I can count up to 5, the amount of friends and co-worker that managed to write good quality C code, since I learned C in 1992.
C++ unfortunately also enjoys the flaws of C due to its C copy-paste capability, but at least I can make use of the type system via structs, classes and operator overloading to enforce code that in C cannot be more than plain patterns.
> I think you are Vastly overestimating the skill level needed to write normatively-correct C code by quite a margin.
Anyway I don't need to proof anything when we have so nice CVE databases full of examples.
Or companies like Apple, which are supposed to have such ideal C programmers, do an OS release with 36 bugs, 31 of these (86%) related to C memory corruption bugs.
https://support.apple.com/en-us/HT206903