Skip to main content

Week 9: MISRA-C and industrial static analysis

What Coverity, the clang static analyzer, and cppcheck actually check for, and how that differs from the formal guarantees of weeks 5–7

19 April 2027

Almost no shipping C codebase uses Checked C or Frama-C. Almost every safety- critical one runs MISRA-C compliance checking plus a commercial or open static analyzer, because those tools trade soundness for something the formal tools don’t offer: they run on your actual, unmodified, un-annotated codebase, today, and tell you something useful before you’ve written a single contract.

MISRA-C is a coding-standard subset of C (no unbounded recursion, restricted pointer arithmetic, and dozens more rules) designed to make the language easier for a static analyzer to say something true about. Coverity and the clang analyzer then run heuristic, deliberately unsound analyses on top: they find real bugs, they miss real bugs, and they occasionally flag correct code. That’s the industrial bet — a checker that catches most of the cheap bugs for near-zero annotation cost beats a checker that catches all of them for an annotation cost nobody will pay.

Outline

Teaching team