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++ |
| CodeChecker | Platform for running static analysers and managing code defects |
| Uncrustify | Source code beautifer |
| Infer | Static analyser that detects bugs in Java, C and C++ code |
| Include What You Use | Source analysis tool for C and C++ projects built on Clang |
| Cppcheck | Static analysis tool for C/C++ code |
| flawfinder | Scans C and C++ source code for potential security weaknesses |
| clazy | Qt-focused static analyser that catches common C++ mistakes |
| ClangFormat | Code formatting tool |
| Clang-Tidy | Clang-based C++ “linter” tool |
| Smatch | Static analysis tool for finding defects in C code |
| Coccinelle | Semantic patching tool for analysing and transforming C code |
Read our verdict in the software roundup.
LinuxLinks helps you discover the best free and open source software for Linux. Explore our extensive collection of recommended applications, including alternatives to popular proprietary software.We also publish software reviews, Linux tutorials, hardware reviews, free programming books and articles covering the wider open source community. Browse our Linux resources to discover more. Know a useful free and open source Linux application we haven't covered? Suggest a program for inclusion. Has your software been featured on LinuxLinks? Display one of our Featured on LinuxLinks badges on your website or GitHub README. |


Please read our Comment Policy before commenting.