coccinelle
« Back to VersTracker
Description:
Program matching and transformation engine for C code
Type: Formula  |  Latest Version: 1.3.0@0  |  Tracked Since: Dec 17, 2025
Links: Homepage  |  formulae.brew.sh
Category: Developer tools
Tags: c refactoring static-analysis code-transformation ocaml
Install: brew install coccinelle
About:
Coccinelle is a powerful program matching and transformation engine designed specifically for C code. It enables developers to write structural search-and-replace rules using a semantic patch language (SmPL) that resembles standard diff patches. This tool is invaluable for automating large-scale refactoring, enforcing coding patterns, and detecting bugs across complex codebases.
Key Features:
  • Semantic patch language (SmPL) for expressive transformations
  • Structural awareness of C syntax and types
  • Scalable analysis of large codebases
  • Integration with build systems and version control
Use Cases:
  • Automated refactoring of C code across large projects
  • Enforcing coding standards and security patterns
  • Detecting and fixing bug patterns statically
Alternatives:
  • Clang-Tidy – Part of LLVM toolchain; provides linting and some refactoring but uses different rule syntax
  • Coccinelle (standalone) – Same tool, but Homebrew formula provides easier installation and dependency management on macOS
License: GPL-2.0-only
Dependencies: ocaml, pcre
Bottles available for: arm64_tahoe, arm64_sequoia, arm64_sonoma, sonoma, arm64_linux, x86_64_linux
Version History
Detected Version Rev Change Commit
Dec 15, 2024 4:35am 0 VERSION_BUMP cff8c0d2
Dec 14, 2024 7:58pm 0 VERSION_BUMP 8f5744fc
Nov 17, 2024 8:37pm 0 VERSION_BUMP 31a50bed
Nov 12, 2024 4:42pm 0 VERSION_BUMP 4ee0c80e
Nov 12, 2024 3:33pm 0 VERSION_BUMP 32ba3166