2 ms·
For good practices in writing high-reliability C, look at these: http://lars-lab.jpl.nasa.gov/JPL_Coding_Standard_C.pdf http://lars-lab.jpl.nasa.gov/JPL_Coding
by wrp 11y ago
For good practices in writing high-reliability C, look at these:
http://lars-lab.jpl.nasa.gov/JPL_Coding_Standard_C.pdf http://lars-lab.jpl.nasa.gov/JPL_Coding_Standard_C.pdf
http://www.leshatton.org/MISRA_comp_1105.html http://www.leshatton.org/MISRA_comp_1105.html
http://www.leshatton.org/ISOC_subset1103.html http://www.leshatton.org/ISOC_subset1103.html
http://www.embedded.com/electronics-blogs/embedded-systems-design-magazine-archive/4216555/Embedded-Systems-Design--May-2011 http://www.embedded.com/electronics-blogs/embedded-systems-d...
For the related topic of secure code, these books are good:
Mark Dowd. 2006. The Art of Software Security Assessment.
Robert Seacord. 2013. Secure Coding in C and C++, 2e.
For details on what is really going on inside C:
Paul Anderson. 1998. Advanced C: Tips and Techniques.
Kenneth Louden. 1997. Compiler Construction: Principles and Practice. Chapter 7.
For C gotchas and general good practices:
http://www.cs.tufts.edu/comp/40/reference/CTrapsAndPitfalls.pdf http://www.cs.tufts.edu/comp/40/reference/CTrapsAndPitfalls....
Allen Holub. 1995. Enough Rope to Shoot Yourself in the Foot.
P.J. Plauger. 1991. The Standard C Library. (It is partly a reference, but also has detailed discussion of the technical considerations faced in writing reliable code.)
- davismwfl 11y agoThis is a good list. Reading and learning about the embedded world can help anyone grasp recovery and error handling techniques. Also, in C a solid understanding of errno and how to properly utilize it is important. Also, at least personally, I stick to 3 key basic rules in C/C++ (I have a lot more, but these are important): 1. Functions should do 1 thing and only 1 thing. The minute a function tries to do 2 or 3 things, or it goes over 50-60 lines (with a few exceptions around conditionals) it is trying to do to much. 2. Check all parameters for validity before doing anything else in the function. 3. Check all return values. Really solid and reliable code is usually way less complex then what you see in a lot of code bases. That doesn't mean it isn't a super complex problem getting solved, just that the reliability is gained by having simplicity at the lowest levels. As someone mentioned Doom is a good example of a solid code base that does some pretty complex things, but cleanly and simply overall.