Smatch – static analyser for C code

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
OCLintStatic code analysis tool for improving quality and reducing defects
cpplintStatic code checker for C++
CodeCheckerPlatform for running static analysers and managing code defects
UncrustifySource code beautifer
InferStatic analyser that detects bugs in Java, C and C++ code
Include What You UseSource analysis tool for C and C++ projects built on Clang
CppcheckStatic analysis tool for C/C++ code
flawfinderScans C and C++ source code for potential security weaknesses
clazyQt-focused static analyser that catches common C++ mistakes
ClangFormatCode formatting tool
Clang-TidyClang-based C++ “linter” tool
SmatchStatic analysis tool for finding defects in C code
CoccinelleSemantic patching tool for analysing and transforming C code

Read our verdict in the software roundup.


Best Free and Open Source Software 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.
Subscribe

Please read our Comment Policy before commenting.

Notify of
guest
0 Comments
Oldest
Newest Most Voted