Coccinelle (software)

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by Bender235 (talk | contribs) at 22:24, 21 July 2016 (→‎top: clean up; http->https (see this RfC) using AWB). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Coccinelle
Stable release
1.0.5[1] / June 2, 2016; 7 years ago (2016-06-02)
Repository
Written inOCaml and Python
TypeStatic program analysis
LicenseGNU GPL v2
Websitecoccinelle.lip6.fr

Coccinelle (French for ladybug) is an open-source utility for matching and transforming the source code of programs written in the C programming language. Coccinelle was initially used to aid the evolution of the Linux kernel, providing support for changes to library application programming interfaces (APIs) such as renaming a function, adding a function argument whose value is somehow context-dependent, and reorganizing a data structure. The source code to be matched or replaced is specified using a pattern very similar to C, called Semantic Patch Language.[2][3]

Support for Coccinelle is provided by IRILL. Funding for the development has been provided by the Agence Nationale de la Recherche (France), the Danish Research Council for Technology and Production Sciences, and INRIA.

The source code of Coccinelle is licensed under the terms of version 2 of the GNU General Public License (GPL).

Example

@@
expression lock, flags;
expression urb;
@@

 spin_lock_irqsave(lock, flags);
 <...
- usb_submit_urb(urb)
+ usb_submit_urb(urb, GFP_ATOMIC)
 ...>
 spin_unlock_irqrestore(lock, flags);

@@
expression urb;
@@

- usb_submit_urb(urb)
+ usb_submit_urb(urb, GFP_KERNEL)

References

  1. ^ "Coccinelle: A Program Matching and Transformation Tool for Systems Code: Downloads". coccinelle.lip6.fr. Retrieved 2016-06-09.
  2. ^ Valerie Henson (2009-01-20). "Semantic patching with Coccinelle". Linux Weekly News. Retrieved 2011-04-25.
  3. ^ Wolfram Sang (2010-03-30). "Evolutionary development of a semantic patch using Coccinelle". Linux Weekly News. Retrieved 2011-04-25.

External links