SourceForge Logo Smatch Logo

Smatch

Smatch is a Free GPL static analysis tool that has been used in the Linux kernel for over 15 years with over 8000 bugs found.

Smatch provides better flow analysis, meaning that it understands the code better than other static analysis tools. It tracks the relationships between variables so it's able to say "if x is 4 that means y is 5" etc. Another important feature is cross function analysis where Smatch tracks how functions are called and what they return.

Smatch is extensible. It's easy to write checks specifically for your project.

Smatch is an Old School, pre-AI static analysis tool. Humans, AI and static checkers all look for code which violates certain heuristics. It makes sense to use all three tools. AI time is cheaper than human time. Static checkers are cheaper to run than AI agents, but the writing the checks is more expensive. The way to move forward in the new AI world is to set the AI to writing static checker checks.

Update: 2026-04-08: Introducing Smatch-CI:

Smatch-CI is a demo to show how Smatch could be integrated into a CI tool.

Code

Documentation

Email archive

Email the developers