Smatch is a static analysis tool for C source code.
The analyser builds on Sparse, the semantic parser originally created for analysing C. Smatch adds its own large collection of checks and tracks information about variables as code is processed, allowing it to identify suspicious conditions that simpler syntax-based tools may overlook.
Although its strongest focus is kernel development, Smatch can also be used to inspect other C projects. The project includes scripts for running analyses across large source trees and continues to receive development work.
This is free and open source software.
Key Features
- Performs static analysis of C source code.
- Built around the Sparse semantic parser.
- Includes extensive checks aimed at Linux kernel code.
- Tracks possible values assigned to variables.
- Performs data-flow analysis across control paths.
- Can identify suspicious error handling and pointer usage.
- Includes checks for locking and resource-management problems.
- Supports analysis of large source trees.
- Can store analysis information in a database for more extensive checking.
- Designed to complement compiler warnings and other static analysis tools.
Website: github.com/error27/smatch
Support:
Developer: Dan Carpenter
License: GNU General Public License v2.0
Smatch is written in C. Learn C with our recommended free books and free tutorials.
Related Software
| C and C++ Linters | |
|---|---|
| OCLint | Static code analysis tool for improving quality and reducing defects |
| cpplint | Static code checker for C++ |
| Uncrustify | Source code beautifer |
| Include What You Use | Source analysis tool for C and C++ projects built on Clang |
| Cppcheck | Static analysis tool for C/C++ code |
| ClangFormat | Code formatting tool |
| Clang-Tidy | Clang-based C++ “linter” tool |
Read our verdict in the software roundup.
Explore our carefully curated directory of recommended free and open source software, covering every major software category.The directory forms part of our extensive collection of articles for Linux enthusiasts. It includes hundreds of detailed reviews, together with free and open source alternatives to proprietary software from companies such as Google, Microsoft, Apple, Adobe, IBM, Cisco, Oracle, and Autodesk. LinuxLinks also covers interesting projects worth exploring, Linux-compatible hardware, free programming books and tutorials, and much more. Know a useful free and open source Linux application that we haven’t covered? Tell us about it using our submission form. |


Please read our Comment Policy before commenting.