C Programming • C17 baseline, standards-specific features labeled
Static Analysis, Sanitizers, and Fuzz Testing
Combine complementary tools to discover memory errors, suspicious paths, and parser edge cases.
Static analyzers inspect code paths without running every input. Sanitizers instrument executed paths. Fuzzers generate many inputs and are especially useful for parsers and decoders. Each tool has blind spots, so keep ordinary tests and code review in the process.
Example
cc -std=c17 -g -O1 -fsanitize=address,undefined -fno-omit-frame-pointer parser.c -o parser-test
./parser-test
What to expect
The instrumented build can report certain memory errors and undefined operations exercised by the test run.
Key idea: Keep a reproducible test case for every discovered defect and rerun it in continuous integration.