The "only thing" (FOSS UNIX clones) is kind of a gigantic thing.
The Windows kernel is mostly written in C, too. iOS uses Objective C.
Modern C++ isn't bad, but robust classes require an enormous effort together with tests suites that approach the size of test suites required for an untyped Python module.
In practice segfaults are as prevalent in C++ as they are in C. Type errors by implicit conversions are more frequent in C++ than they are in C. Full testing of all conversion rules requires a superhuman effort.
So I think well written C is often safer than well written C++, because one does not have to deal with the case explosions introduced by classes and their implicit rules.
The often quoted safer strings in C++ are just a very tiny part of the equation.
If I had my way, we'd all be writing Ada or Standard ML, but no one listens.
The Windows kernel is mostly written in C, too. iOS uses Objective C.
Modern C++ isn't bad, but robust classes require an enormous effort together with tests suites that approach the size of test suites required for an untyped Python module.
In practice segfaults are as prevalent in C++ as they are in C. Type errors by implicit conversions are more frequent in C++ than they are in C. Full testing of all conversion rules requires a superhuman effort.
So I think well written C is often safer than well written C++, because one does not have to deal with the case explosions introduced by classes and their implicit rules.
The often quoted safer strings in C++ are just a very tiny part of the equation.
If I had my way, we'd all be writing Ada or Standard ML, but no one listens.