Skip to the content
Know your tech before you buy it. Makers: get listed from $49/mo

Coccinelle

coccinelle.gitlabpages.inria.fr

  • Free plan
  • macOS
  • Linux

What Coccinelle is

Coccinelle is a free program matching and transformation engine for C code, available on Linux and macOS. It uses SmPL to describe code patterns and the changes to apply when a match is found. A single semantic patch can modify code across many files and sites while allowing differences in spacing, variable names, irrelevant code, and coding style. The project describes using it to automate collateral changes after library API evolution and to find and fix bugs in systems code. Coccinelle semantic patch changes and bug fixes have been integrated into the official Linux tree. The Linux scripts directory also contains semantic patches, and coccicheck can apply multiple SmPL files to a project. The project says its C++ support is being extended, including for high performance computing; C++ mode is invoked with --c++. The download page lists version 1.3.3, dated September 2, 2026, and offers source code and precompiled spatch builds. Building from source requires OCaml; Python and Menhir are needed in specified build situations. Documentation includes spatch options, an annotated SmPL grammar, examples, and an introductory lecture.

Who it suits

Coccinelle suits developers working on large C codebases who need repeatable, pattern-based changes or bug-finding workflows. It may also interest C++ users exploring the project's developing support.

Good to know, and what to watch

  • Semantic patches can modify code across many files.
  • Designed for API-evolution changes and systems-code bug fixing.
  • Semantic patch changes have reached the official Linux tree.
  • Free on Linux and macOS.
  • Source and precompiled spatch builds are offered.
  • Source builds require OCaml.
  • Python and Menhir are needed in specified build situations.
  • C++ support is still being extended.

Coccinelle

Free

Free plan

Getting started

  1. Open the Coccinelle project website
  2. Download source code or a precompiled spatch build
  3. Install Coccinelle on Linux or macOS
  4. Install OCaml for a source build
  5. Add Python or Menhir when the build situation requires them
  6. Read the SmPL grammar and introductory documentation
  7. Run C++ mode with --c++ when working on C++ code

The verdict

Coccinelle is geared toward structured, repository-wide C transformations rather than one-off editing. Review its build requirements and SmPL documentation before adopting it in a workflow.

Questions people ask

Is Coccinelle free?

Yes. The project lists a free plan at no cost and no paid plan information.

Which operating systems are supported?

Coccinelle is available as desktop software for Linux and macOS.

Which languages does it support?

Its supported languages are C and C++. C++ mode is invoked with --c++.

What is SmPL used for?

SmPL specifies the code patterns to match and the transformations to apply.

How can I get Coccinelle?

The download page provides source code and precompiled spatch builds.

Where can users ask questions?

Questions can be sent to the moderated [email protected] mailing list.

What the maker publishes

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. source
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++. source
Documentation
The project provides spatch option documentation, an SmPL grammar document with annotated examples, additional examples, and an introductory lecture. source
Download
The official download page lists version 1.3.3, dated September 2, 2026, and provides source code and precompiled spatch builds. source
Linux integration
Coccinelle semantic patches are available in the Linux scripts directory, and coccicheck scripts can apply multiple SmPL files to one project. source
Linux kernel
The project lists semantic patch changes and bug fixes that have been integrated into the official Linux tree. source
Maintainers
The project lists Julia Lawall, Victor Gambier, Michele Martone, and Tathagata Roy as people currently working on Coccinelle. source
Platforms
The download page provides packages for several Linux distributions and says Coccinelle can be installed with brew on Linux and macOS. source
Purpose
Coccinelle is a program matching and transformation engine that uses SmPL to specify desired matches and transformations in C code. source
Security
The official pages opened for this research do not state security certifications, compliance claims, or a security program. source
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. source
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. source
Use cases
The project describes use for automating collateral code changes after library API evolution and for finding and fixing bugs in systems code. source

Checked against the maker's pages on 5 Oct 2026.