2 ms·
Do you find C/C++ acceptable from a safety/reliability perspective, or do you write in safer languages (Fortran, Ada)? AFAIK critical software coding standards
by tomp 8y ago
Do you find C/C++ acceptable from a safety/reliability perspective, or do you write in safer languages (Fortran, Ada)?
AFAIK critical software coding standards forbid dynamic memory allocation, so things like stack overflows, null dereference or out-of-memory errors can't happen, but array-out-of-bounds exceptions can still get you. On the other hand, static verification tools catch most of that.
- marsRoverDev 8y agoC/C++ is fine as long as you adhere to coding standards like MISRA and you thoroughly test it. Our code for example, is unit tested, then we have java tests running on a server-based simulator, then other independently written java tests running on test benches that more closely represent the spacecraft itself, then a replica of the spacecraft. The industry used to use Fortran / Ada quite extensively, and depending on company/organisation and team, might still do so. Things like the F-35 are written in C++, which is where I can see these things heading.
- antoinealb 8y agoSafety critical standards indeed forbid memory allocation usually. If you want more details you can search for MISRA C (automotive market), the standards can be found online. That being said, stack overflows and null derefs are not caused by dynamic memory allocation, so you still have to be careful about those and use some other rules / tools to protect you.