Source code of the Coccinelle project
OCaml C Makefile Python Shell Perl Other
Switch branches/tags
v1.0.0-rc8 ubuntu/15.04-vivid/1.0.2 ubuntu/14.04-trusty/1.0.2 ubuntu/14.04-trusty/1.0.0-rc22 ubuntu/13.10-saucy/1.0.0-rc21 ubuntu/12.04-precise/1.0.0-rc22 ubuntu/12.04-precise/1.0.0-rc21 ubuntu/1.0.0-rc14 ubuntu/1.0.0-rc13 ubuntu/1.0.0-rc12 ubuntu/1.0.0-rc11 ubuntu/1.0.0-rc10 ubuntu/1.0.0-rc9 ubuntu/1.0.0-rc8 start release-1-0-0-rc4 first_evo eurosys07-submission coccinelle-1.0.1 coccinelle-1.0.0 coccinelle-1.0.0-rc24 coccinelle-1.0.0-rc23 coccinelle-1.0.0-rc22 coccinelle-1.0.0-rc21 coccinelle-1.0.0-rc20 coccinelle-1.0.0-rc19 coccinelle-1.0.0-rc18 coccinelle-1.0.0-rc17 coccinelle-1.0.0-rc16 coccinelle-1.0.0-rc15 coccinelle-1.0.0-rc14 coccinelle-1.0.0-rc13 coccinelle-1.0.0-rc12 coccinelle-1.0.0-rc11 coccinelle-1.0.0-rc9 coccinelle-1.0.0-rc5 coccinelle-1.0.0-rc4 coccinelle-1.0.0-rc3 coccinelle-1.0.0-rc2 coccinelle-1.0.0-rc1 coccinelle-1-0-0-rc7 coccinelle-1-0-0-rc6 coccinelle-1-0-0-rc5 coccinelle-0.2.5 coccinelle-0.2.5-rc9 coccinelle-0.2.5-rc8 coccinelle-0.2.5-rc7 coccinelle-0.2.5-rc6 coccinelle-0.2.5-rc5 coccinelle-0.2.5-rc4 coccinelle-0.2.5-rc3 coccinelle-0.2.5-rc2 coccinelle-0.2.5-rc1 coccinelle-0.2.4 coccinelle-0.2.4rc6 coccinelle-0.2.4rc5 coccinelle-0.2.4rc4 coccinelle-0.2.4rc3 coccinelle-0.2.4rc2 coccinelle-0.2.4rc1 coccinelle-0.2.3 coccinelle-0.2.3rc6 coccinelle-0.2.3rc5 coccinelle-0.2.3rc4 coccinelle-0.2.3rc3 coccinelle-0.2.3rc2 coccinelle-0.2.3rc1 coccinelle-0.2.2 coccinelle-0.2.2-rc2 coccinelle-0.2.2-rc1 coccinelle-0.2.1 coccinelle-0.2.1-rc1 coccinelle-0.2.0 coccinelle-0.2.0rc1 coccinelle-0.1.11 coccinelle-0.1.11rc1 coccinelle-0.1.10 coccinelle-0.1.9 coccinelle-0.1.9-rc1 coccinelle-0.1.8 coccinelle-0.1.7 coccinelle-0.1.6 coccinelle-0.1.6a coccinelle-0.1.5 coccinelle-0.1.4 coccinelle-0.1.3 coccinelle-0.1.2 coccinelle-0.1.1 coccinelle-0.1 1.0.6 1.0.5 1.0.4 1.0.3 1.0.2 1.0.1 1.0.0 1.0.0-rc35 1.0.0-rc24 1.0.0-rc23 1.0.0-rc22
Nothing to show
Clone or download
JuliaLawall Keep whitespace before comments in statements and declarations.
This consists in adding an "original" field to the MetaVals of
statements and declarations.  This field is just passed around during
the matching process, but is used if the statement or declaration
metavariable ever appears in + code.  If this is not done, the
whitespace in the comments all disappears, and the commented out things
run together in the result.  This is illustrated by the following
command line:

spatch -test copys --macro-file-builtins soa.h

The changes required are to use this original field in
parsing_c/unparse_c.ml, to update ctlcocci_integration.ml to ignore it,
to update lib_parsing_c.ml to add a real_strip function that keeps
comments, to update cocci_vs_c.ml to add the original field, and to
update various other files to ignore it.

This could be done for other metavariable types if it seems to be useful.
Latest commit 97695d0 Aug 12, 2018
Permalink
Failed to load latest commit information.
bundles Remove spurious $(info) Jul 31, 2018
commons Replace pidpath and realpath by pure implementations Jul 4, 2018
ctl drop afters from consideration on A ops May 26, 2018
debian Get rid of the --enable-release configure option. Mar 18, 2016
demos demos: python_regexp: Fix regex matching Jan 15, 2018
docs add --suffix options, allow -o when only main file changes but header… Aug 9, 2018
editors Remove a bunch of trailing whitespaces and blank lines at end of files. Aug 10, 2015
engine Keep whitespace before comments in statements and declarations. Aug 12, 2018
extra Support for compiling single library Sep 8, 2017
globals Replace pidpath and realpath by pure implementations Jul 4, 2018
ocaml Keep whitespace before comments in statements and declarations. Aug 12, 2018
parsing_c Keep whitespace before comments in statements and declarations. Aug 12, 2018
parsing_cocci Add back in the ability to consider symbols to be constants in metava… Aug 9, 2018
popl typos Jun 9, 2017
popl09 Support for compiling single library Sep 8, 2017
python Keep whitespace before comments in statements and declarations. Aug 12, 2018
scripts typos Jun 9, 2017
setup Fix Makefile dependencies Jul 19, 2018
tests Keep whitespace before comments in statements and declarations. Aug 12, 2018
tools metavar as include argument Jul 4, 2018
.gitignore Ignore stdcompat.cmxs Dec 20, 2017
.merlin Share the .merlin file. Mar 14, 2016
Makefile Silent ocaml/parmap.cmx rule if unavailable Aug 6, 2018
Makefile.am always wraps calls to pkg-config, just in case it does not have full … Aug 23, 2012
Makefile.common typos Jun 9, 2017
Makefile.config.in --with-bash-completion option Aug 6, 2018
Makefile.dev typos Jun 9, 2017
Makefile.library Support for compiling single library Sep 8, 2017
Makefile.libs Remove old reference to bundles/parmap/parmap-1.0-rc7 Jul 31, 2018
Makefile.release typo Jun 9, 2017
authors.txt Remove a bunch of trailing whitespaces and blank lines at end of files. Aug 10, 2015
autogen autogen: add -Wall to the invocation of autoconf. Sep 23, 2015
bugs.txt Removed Yoann E-mail from bugs.txt Nov 29, 2013
changes.txt Keep whitespace before comments in statements and declarations. Aug 12, 2018
cocci.ml more for hashinc, also some code for compiling scripts even when the … Jul 4, 2018
cocci.mli more for hashinc, also some code for compiling scripts even when the … Jul 4, 2018
coccinelle.ml Keep only Regexp.* reference Feb 14, 2018
coccinelle.mli Coccinelle OCaml interface Feb 13, 2018
configure.ac --with-bash-completion option Aug 6, 2018
copyright.txt Update copyright for 2010 Jan 28, 2010
credits.txt Remove a bunch of trailing whitespaces and blank lines at end of files. Aug 10, 2015
empty.h new file Mar 27, 2008
empty.iso big refactoring Aug 6, 2006
enter.ml add --suffix options, allow -o when only main file changes but header… Aug 9, 2018
enter.mli missing file Feb 13, 2018
env.csh Better coordination between coccinelle and coccicheck Jan 4, 2010
env.sh Remove a bunch of trailing whitespaces and blank lines at end of files. Aug 10, 2015
flag_cocci.ml move inplace flag for future use in cocci.ml Aug 21, 2017
flag_cocci.mli Missing .mlis Sep 6, 2017
install.txt --with-bash-completion option Aug 6, 2018
license.txt Changed for the GPL license distributed by the FSF. Apr 13, 2016
main.ml Coccinelle OCaml interface Feb 13, 2018
main.mli Fixed Makefile Sep 6, 2017
make-release.sh make-release.sh script Jul 4, 2018
read_options.ml close option file Jul 28, 2017
read_options.mli typos Jun 9, 2017
readme.txt Remove a bunch of trailing whitespaces and blank lines at end of files. Aug 10, 2015
standard.h drop some declares that are no longer useful May 6, 2018
standard.iso drop some unsafe isos - unsafe in case of replacement of the decl, wh… Mar 14, 2016
testing.ml compile scripts, even if currently under a false dependency Jul 4, 2018
testing.mli compile scripts, even if currently under a false dependency Jul 4, 2018
version Release 1.0.7 Jul 4, 2018
version.ml.in Makefile/configure tuning. Apr 13, 2012
version.sh autotools: add localversion information Aug 11, 2015

readme.txt

                            Coccinelle


Coccinelle allows programmers to easily write some complex
style-preserving source-to-source transformations on C source code,
like for instance to perform some refactorings.

To install Coccinelle from its source, see the instructions in install.txt.
Once you have installed coccinelle, there is a script 'spatch' in /usr/bin
or /usr/local/bin that invokes the Coccinelle program.

If you want to run Coccinelle without installing it, you can run the
Coccinelle program directly from the download/build directory. You may then
have to setup a few environment variables so that the Coccinelle program
knows where to find its configuration files.
For bash do:

  $ source env.sh

For tcsh do:

  $ source env.csh


You can test coccinelle with:

  $ spatch -sp_file demos/simple.cocci demos/simple.c -o /tmp/new_simple.c

If you haven't installed coccinelle, run then ./spatch or ./spatch.opt



If you downloaded the bytecode version of spatch you may first
have to install OCaml (which contains the 'ocamlrun' bytecode interpreter,
the equivalent of 'java', the Java virtual machine, but for OCaml) and then do:

  $ ocamlrun spatch -sp_file demos/simple.cocci demos/simple.c -o /tmp/new_simple.c


For more information on Coccinelle, type 'make docs' and have a look at the
files in the docs/ directory. You may need to install the texlive-fonts-extra
packages from your distribution to compile some of the LaTeX documentation
files.

 ** Runtime dependencies under Debian/Ubuntu**

 - For the OCaml scripting feature in SmPL
	ocaml-native-compilers
     or ocaml-nox

---------------------------------------------------------------------------

Contributing:

Contributions are welcome.  Please sign your contributions, according to
the following text extracted from Documentation/SubmittingPatches.txt of
the Linux kernel:

The sign-off is a simple line at the end of the explanation for the
patch, which certifies that you wrote it or otherwise have the right to
pass it on as an open-source patch.  The rules are pretty simple: if you
can certify the below:

        Developer's Certificate of Origin 1.1

        By making a contribution to this project, I certify that:

        (a) The contribution was created in whole or in part by me and I
            have the right to submit it under the open source license
            indicated in the file; or

        (b) The contribution is based upon previous work that, to the best
            of my knowledge, is covered under an appropriate open source
            license and I have the right under that license to submit that
            work with modifications, whether created in whole or in part
            by me, under the same open source license (unless I am
            permitted to submit under a different license), as indicated
            in the file; or

        (c) The contribution was provided directly to me by some other
            person who certified (a), (b) or (c) and I have not modified
            it.

	(d) I understand and agree that this project and the contribution
	    are public and that a record of the contribution (including all
	    personal information I submit with it, including my sign-off) is
	    maintained indefinitely and may be redistributed consistent with
	    this project or the open source license(s) involved.

then you just add a line saying

	Signed-off-by: Random J Developer <random@developer.example.org>

using your real name (sorry, no pseudonyms or anonymous contributions.)