- Home
- Code Refactoring Tools
- Coccinelle
Coccinelle
What it is
Coccinelle is a program matching and transformation engine for C code. It uses SmPL to describe code patterns and the edits to apply, so one semantic patch can make changes across hundreds of files and thousands of code sites while accommodating differences in spacing, names, irrelevant code, and style. The project describes using it to automate changes after library API evolution and to locate and fix bugs in systems code. Semantic patch changes and bug fixes have been integrated into the official Linux tree; patches are also available in Linux’s scripts directory, where coccicheck can apply multiple SmPL files to a project. Coccinelle supports C and C++, though its C++ work is still being extended; C++ mode is invoked with --c++. It is free desktop software for Linux and macOS. The download page lists version 1.3.3, dated September 2, 2026, and offers source code and precompiled spatch builds. Source builds require OCaml; Python and Menhir are needed in specified circumstances. Documentation includes spatch options, an annotated SmPL grammar, examples, and a lecture.
For and against
For
- One patch can change code across many files and sites.
- Targets API-driven changes and systems-code bug fixes.
- Linux integration includes patches and bug fixes.
- Free for Linux and macOS desktop use.
- Documentation includes grammar, examples, and options.
Against
- Building from source requires OCaml.
- Python and Menhir are needed in certain build situations.
- C++ support is still being extended.
The verdict
Coccinelle focuses on broad, syntax-aware transformations in C code, with uses described for API changes and systems-code fixes. Check the build requirements and the ongoing status of C++ support against your project needs.
Who it suits
Coccinelle suits developers maintaining C systems code or adapting code after library API changes. It may also suit teams exploring C++ transformations or high performance computing applications.
Plans and prices
Coccinelle
No paid plan information stated on the official site
Read 5 Oct 2026 · coccinelle.gitlabpages.inria.fr
On the record
- 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.coccinelle.gitlabpages.inria.fr · read 5 Oct 2026
- 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++.coccinelle.gitlabpages.inria.fr · read 5 Oct 2026
- Documentation
- The project provides spatch option documentation, an SmPL grammar document with annotated examples, additional examples, and an introductory lecture.coccinelle.gitlabpages.inria.fr · read 5 Oct 2026
- Download
- The official download page lists version 1.3.3, dated September 2, 2026, and provides source code and precompiled spatch builds.coccinelle.gitlabpages.inria.fr · read 5 Oct 2026
- Linux integration
- Coccinelle semantic patches are available in the Linux scripts directory, and coccicheck scripts can apply multiple SmPL files to one project.coccinelle.gitlabpages.inria.fr · read 5 Oct 2026
- Linux kernel
- The project lists semantic patch changes and bug fixes that have been integrated into the official Linux tree.coccinelle.gitlabpages.inria.fr · read 5 Oct 2026
- Maintainers
- The project lists Julia Lawall, Victor Gambier, Michele Martone, and Tathagata Roy as people currently working on Coccinelle.coccinelle.gitlabpages.inria.fr · read 5 Oct 2026
- Purpose
- Coccinelle is a program matching and transformation engine that uses SmPL to specify desired matches and transformations in C code.coccinelle.gitlabpages.inria.fr · read 5 Oct 2026
- Security
- The official pages opened for this research do not state security certifications, compliance claims, or a security program.coccinelle.gitlabpages.inria.fr · read 5 Oct 2026
- 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.coccinelle.gitlabpages.inria.fr · read 5 Oct 2026
- 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.coccinelle.gitlabpages.inria.fr · read 5 Oct 2026
- Use cases
- The project describes use for automating collateral code changes after library API evolution and for finding and fixing bugs in systems code.coccinelle.gitlabpages.inria.fr · read 5 Oct 2026