Coccinelle
coccinelle.gitlabpages.inria.fr
What it is
Coccinelle is a free program matching and transformation engine for working with C code. It uses SmPL to describe code patterns and the transformations to apply when matches are found. A single semantic patch can change code at many sites across hundreds of files while allowing for differences in spacing, variable names, irrelevant code, and coding style. The project describes uses including automating collateral changes after library API evolution and finding and fixing bugs in systems code. Coccinelle semantic patches and bug fixes have been integrated into the official Linux tree, and semantic patches are available in the Linux scripts directory for use with coccicheck. It supports C and C++, with C++ mode invoked using --c++; the project says its C++ support is still being extended, including for high performance computing. The download page lists version 1.3.3, dated September 2, 2026, with source code and precompiled spatch builds. It is available for Linux and macOS as desktop software. Source builds require OCaml, with Python and Menhir needed in specified cases.
Spec sheet
- Purpose
- Coccinelle is a program matching and transformation engine that uses SmPL to specify desired matches and transformations in C code.Read 5 Oct 2026 · coccinelle.gitlabpages.inria.fr
- Platforms
- The download page provides packages for several Linux distributions and says Coccinelle can be installed with brew on Linux and macOS.Read 5 Oct 2026 · coccinelle.gitlabpages.inria.fr
- Security
- The official pages opened for this research do not state security certifications, compliance claims, or a security program.Read 5 Oct 2026 · coccinelle.gitlabpages.inria.fr
- Support
- Questions can be sent to the [email protected] mailing list, which is moderated for non-members; contributions are preferred via the list and may also be submitted on GitHub.Read 5 Oct 2026 · coccinelle.gitlabpages.inria.fr
- Build requirements
- Building from source requires OCaml, optionally Python 2.5–2.7 or Python 3, and Menhir when modifying the SmPL grammar or after make distclean.Read 5 Oct 2026 · coccinelle.gitlabpages.inria.fr
- C++ and HPC
- The project says Coccinelle is being extended for C++ code, with high performance computing as an application area, and C++ mode is invoked with --c++.Read 5 Oct 2026 · coccinelle.gitlabpages.inria.fr
- Documentation
- The project provides spatch option documentation, an SmPL grammar document with annotated examples, additional examples, and an introductory lecture.Read 5 Oct 2026 · coccinelle.gitlabpages.inria.fr
- Download
- The official download page lists version 1.3.3, dated September 2, 2026, and provides source code and precompiled spatch builds.Read 5 Oct 2026 · coccinelle.gitlabpages.inria.fr
- Linux integration
- Coccinelle semantic patches are available in the Linux scripts directory, and coccicheck scripts can apply multiple SmPL files to one project.Read 5 Oct 2026 · coccinelle.gitlabpages.inria.fr
- Linux kernel
- The project lists semantic patch changes and bug fixes that have been integrated into the official Linux tree.Read 5 Oct 2026 · coccinelle.gitlabpages.inria.fr
- Maintainers
- The project lists Julia Lawall, Victor Gambier, Michele Martone, and Tathagata Roy as people currently working on Coccinelle.Read 5 Oct 2026 · coccinelle.gitlabpages.inria.fr
- Semantic patches
- A single semantic patch can modify hundreds of files at thousands of code sites while abstracting over spacing, variable names, irrelevant code, and coding style.Read 5 Oct 2026 · coccinelle.gitlabpages.inria.fr
- Use cases
- The project describes use for automating collateral code changes after library API evolution and for finding and fixing bugs in systems code.Read 5 Oct 2026 · coccinelle.gitlabpages.inria.fr
Plans and prices
Strong points and limits
Strong points
- Semantic patches can transform many files and code sites
- Supports C and C++
- Linux scripts include patches usable with coccicheck
- Free for Linux and macOS
Limits
- Building from source requires OCaml
- Python and Menhir are required in certain build situations
- C++ support is still being extended
Who it suits
Coccinelle suits developers maintaining C code who need to automate broad, pattern-based changes or find and fix systems-code bugs. It may also interest users working with the project's C++ mode.
Verdict
Coccinelle is a focused option for repository-wide code matching and transformations expressed in SmPL. Check the source-build requirements and the project's ongoing C++ extension if those affect your setup.
Where Specifiction places it
- Code Refactoring Tools#9 of 227.9