Skip to content

Commit

Permalink
Release of coccinelle-1.0.0-rc18
Browse files Browse the repository at this point in the history
Coccinelle version 1.0.0-rc18 has been released.  Most of the changes are
bugs fixes, related to position variables, function prototypes, and pretty
printing.  It is not possible to match and transform some kinds of
pragmas.  There is also some support for IBM C's decimal type, with the
--ibm option.
  • Loading branch information
Coccinelle authored and rrhansen committed Aug 26, 2013
1 parent 1b9ae60 commit a746521
Show file tree
Hide file tree
Showing 146 changed files with 8,379 additions and 5,441 deletions.
87 changes: 40 additions & 47 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -141,32 +141,29 @@ all: Makefile.config

# make "all" comes in three flavours
world: Makefile.config version.ml
@echo "building both versions of spatch"
@$(ECHO) "Building both versions of spatch"
$(MAKE) .depend
$(MAKE) byte
$(MAKE) opt-compil
$(MAKE) preinstall
$(MAKE) docs
@echo ""
@echo -e "\tcoccinelle can now be installed via 'make install'"
@$(ECHO) -e "\n\tcoccinelle can now be installed via 'make install'"

# note: the 'all-dev' target excludes the documentation
all-dev: Makefile.config version.ml
@$(MAKE) .depend
@echo "building the unoptimized version of spatch"
@$(ECHO) "Building the unoptimized version of spatch"
$(MAKE) byte
@$(MAKE) preinstall
@echo ""
@echo -e "\tcoccinelle can now be installed via 'make install'"
@$(ECHO) -e "\n\tcoccinelle can now be installed via 'make install'"

all-release: Makefile.config version.ml
@echo building $(TARGET_SPATCH)
@$(ECHO) "Building $(TARGET_SPATCH)"
$(MAKE) .depend
$(MAKE) $(TARGET_SPATCH)
$(MAKE) preinstall
$(MAKE) docs
@echo ""
@echo -e "\tcoccinelle can now be installed via 'make install'"
@$(ECHO) -e "\n\tcoccinelle can now be installed via 'make install'"

all.opt: Makefile.config
@$(MAKE) .depend
Expand All @@ -177,15 +174,15 @@ byte: Makefile.config version.ml
@$(MAKE) .depend
@$(MAKE) subdirs.all
@$(MAKE) $(EXEC)
@echo the compilation of $(EXEC) finished
@echo $(EXEC) can be installed or used
@$(ECHO) "The compilation of $(EXEC) finished."
@$(ECHO) "$(EXEC) can be installed or used."

opt-compil: Makefile.config version.ml
$(MAKE) .depend
$(MAKE) subdirs.opt BUILD_OPT=yes
$(MAKE) $(EXEC).opt BUILD_OPT=yes
@echo the compilation of $(EXEC).opt finished
@echo $(EXEC).opt can be installed or used
@$(ECHO) "The compilation of $(EXEC).opt finished."
@$(ECHO) "$(EXEC).opt can be installed or used."

top: $(EXEC).top

Expand All @@ -200,14 +197,13 @@ all: Makefile.config
$(MAKE) $(TARGET_ALL)

world: Makefile.config myocamlbuild.ml version.ml prepare-bundles
@echo "building both versions of spatch"
@$(ECHO) "Building both versions of spatch"
$(MAKE) byte
$(MAKE) opt-compil
@$(MAKE) coccilib-cmi
$(MAKE) preinstall
$(MAKE) docs
@echo ""
@echo -e "\tcoccinelle can now be installed via 'make install'"
@$(ECHO) -e "\n\tcoccinelle can now be installed via 'make install'"

# note: the 'all-dev' target excludes the documentation and is less noisy
all-dev: Makefile.config myocamlbuild.ml version.ml prepare-bundles
Expand All @@ -216,13 +212,12 @@ all-dev: Makefile.config myocamlbuild.ml version.ml prepare-bundles
@$(MAKE) preinstall

all-release: Makefile.config myocamlbuild.ml version.ml prepare-bundles
@echo building $(TARGET_SPATCH)
@$(ECHO) "Building $(TARGET_SPATCH)"
$(MAKE) $(TARGET_SPATCH)
@$(MAKE) coccilib-cmi
$(MAKE) preinstall
$(MAKE) docs
@echo ""
@echo -e "\tcoccinelle can now be installed via 'make install'"
@$(ECHO) -e "\n\tcoccinelle can now be installed via 'make install'"

all.opt: Makefile.config myocamlbuild.ml version.ml prepare-bundles
$(MAKE) opt-only
Expand Down Expand Up @@ -281,7 +276,7 @@ $(MAKESUBDIRS:%=%.opt):
prepare-bundles: $(MAKELIBS:%=%/.prepare)

$(MAKELIBS:%=%/.prepare):
echo $@
$(ECHO) $@
@$(MAKE) -C $(@:%.prepare=%) .prepare

#dependencies:
Expand Down Expand Up @@ -339,7 +334,7 @@ configure:
# the dependencies on Makefile.config should give a hint to the programmer that
# configure should be run again
Makefile.config: Makefile.config.in configure.ac
@echo "Makefile.config needs to be (re)build. Run ./configure $(CONFIGURE_FLAGS) to generate it."
@$(ECHO) "Makefile.config needs to be (re)build. Run ./configure $(CONFIGURE_FLAGS) to generate it."
@false

# as above, also for the ocamlbuild plugin
Expand Down Expand Up @@ -391,7 +386,7 @@ endif
##############################################################################

version.ml:
@echo "version.ml is missing. Run ./configure to generate it."
@$(ECHO) "version.ml is missing. Run ./configure to generate it."
@false

##############################################################################
Expand All @@ -404,18 +399,18 @@ docs:
else
docs: prepare-bundles
endif
@$(MAKE) -C docs || (echo "warning: ignored the failed construction of the manual" 1>&2)
@$(MAKE) -C docs || ($(ECHO) "Warning: ignored the failed construction of the manual" 1>&2)
ifneq ($(FEATURE_OCAMLBUILD),yes)
@if test "x$(FEATURE_OCAML)" = x1; then \
if test -f ./parsing_c/ast_c.cmo -o -f ./parsing_c/ast_c.cmx; then \
$(MAKE) -C ocaml doc; \
else echo "note: to obtain coccilib documenation, it is required to build 'spatch' first so that ./parsing_c/ast_c.cm* gets build."; \
else $(ECHO) "Note: to obtain coccilib documenation, it is required to build 'spatch' first so that ./parsing_c/ast_c.cm* gets build."; \
fi fi
else
@if test "x$(FEATURE_OCAML)" = x1; then \
$(MAKE) -C ocaml doc; fi
endif
@echo "finished building manuals"
@$(ECHO) "Finished building manuals"

clean:: Makefile.config
$(MAKE) -C docs clean
Expand Down Expand Up @@ -469,28 +464,28 @@ install-common: ocaml/coccilib/coccilib.cmi
# $(INSTALL_DATA) globals/iteration.cmi $(DESTDIR)$(SHAREDIR)/globals/

install-man:
@echo "Installing manuals in: ${DESTDIR}${MANDIR}"
@$(ECHO) "Installing manuals in: ${DESTDIR}${MANDIR}"
$(MKDIR_P) $(DESTDIR)$(MANDIR)/man1
$(MKDIR_P) $(DESTDIR)$(MANDIR)/man3
$(INSTALL_DATA) docs/spatch.1 $(DESTDIR)$(MANDIR)/man1/
$(INSTALL_DATA) docs/Coccilib.3cocci $(DESTDIR)$(MANDIR)/man3/

install-bash:
@echo "Installing bash completion in: ${DESTDIR}${BASH_COMPLETION_DIR}"
@$(ECHO) "Installing bash completion in: ${DESTDIR}${BASH_COMPLETION_DIR}"
$(MKDIR_P) $(DESTDIR)$(BASH_COMPLETION_DIR)
$(INSTALL_DATA) scripts/spatch.bash_completion \
$(DESTDIR)$(BASH_COMPLETION_DIR)/spatch

install-tools:
@echo "Installing tools in: ${DESTDIR}${BINDIR}"
@$(ECHO) "Installing tools in: ${DESTDIR}${BINDIR}"
$(MKDIR_P) $(DESTDIR)$(BINDIR)
$(INSTALL_PROGRAM) tools/splitpatch \
$(DESTDIR)$(BINDIR)/splitpatch
$(INSTALL_PROGRAM) tools/cocci-send-email.perl \
$(DESTDIR)$(BINDIR)/cocci-send-email.perl

install-python:
@echo "Installing python support in: ${DESTDIR}${SHAREDIR}/python"
@$(ECHO) "Installing python support in: ${DESTDIR}${SHAREDIR}/python"
$(MKDIR_P) $(DESTDIR)$(SHAREDIR)/python/coccilib/coccigui
$(INSTALL_DATA) python/coccilib/*.py \
$(DESTDIR)$(SHAREDIR)/python/coccilib
Expand Down Expand Up @@ -518,12 +513,10 @@ install: install-man install-common install-stubs $(PYTHON_INSTALL_TARGET)
@if test -x spatch.opt ; then \
$(MAKE) install-opt;fi
@if test ! -x spatch -a ! -x spatch.opt ; then \
echo -e "\n\n\t==> Run 'make', 'make opt', or both first. <==\n\n";fi
@echo ""
@echo -e "\tYou can also install spatch by copying the program spatch"
@echo -e "\t(available in this directory) anywhere you want and"
@echo -e "\tgive it the right options to find its configuration files."
@echo ""
$(ECHO) -e "\n\n\t==> Run 'make', 'make opt', or both first. <==\n\n";fi
@$(ECHO) -e "\n\tYou can also install spatch by copying the program spatch"
@$(ECHO) -e "\t(available in this directory) anywhere you want and"
@$(ECHO) -e "\tgive it the right options to find its configuration files.\n"

#
# Installation of spatch and spatch.opt and their wrappers
Expand Down Expand Up @@ -579,9 +572,9 @@ uninstall-tools:
rm -f $(DESTDIR)$(BINDIR)/cocci-send-email.perl

version:
@echo "spatch $(VERSION)"
@echo "spatch $(PKGVERSION) ($(DISTRIB_ID))"
@echo "coccicheck $(CCVERSION)"
@$(ECHO) "spatch $(VERSION)"
@$(ECHO) "spatch $(PKGVERSION) ($(DISTRIB_ID))"
@$(ECHO) "coccicheck $(CCVERSION)"


##############################################################################
Expand All @@ -606,17 +599,17 @@ testparsing:
# * some feature tests (depending on what is enabled)
# * the test suite
check: scripts/spatch
@echo "testing if spatch works on hello world..."
@$(ECHO) "Testing if spatch works on hello world..."
@COCCINELLE_HOME="$$(pwd)" ./scripts/spatch --sp-file demos/hello/hello-smpl.cocci demos/hello/helloworld.c --very-quiet | grep -q '+ printf("world, hello!");'
@echo "testing if spatch works with regexes..."
@$(ECHO) "Testing if spatch works with regexes..."
@COCCINELLE_HOME="$$(pwd)" ./scripts/spatch --sp-file demos/hello/hello-regexp.cocci demos/hello/helloworld.c --very-quiet | grep -q '+ printf("world, hello!");'
@if test "x${FEATURE_OCAML}" = x1 -a -z "${NO_OCAMLFIND}"; then \
echo "testing if spatch works with ocaml scripts..."; \
$(ECHO) "Testing if spatch works with ocaml scripts..."; \
COCCINELLE_HOME="$$(pwd)" ./scripts/spatch --sp-file demos/hello/hello-ocaml.cocci demos/hello/helloworld.c --very-quiet | grep -q 'Hello at: 2'; fi
@if test "x${FEATURE_PYTHON}" = x1; then \
echo "testing if spatch works with python scripts..."; \
$(ECHO) "Testing if spatch works with python scripts..."; \
COCCINELLE_HOME="$$(pwd)" ./scripts/spatch --sp-file demos/hello/hello-python.cocci demos/hello/helloworld.c --very-quiet | grep -q 'Hello at: 2'; fi
@echo running the test suite
@$(ECHO) running the test suite
COCCINELLE_HOME="$$(pwd)" ./scripts/spatch --testall --no-update-score-file

# -inline 0 to see all the functions in the profile.
Expand Down Expand Up @@ -644,7 +637,7 @@ dependencygraph:
# each member of the project can have its own test.ml. this file is
# not under CVS.
test.ml:
echo "let foo_ctl () = failwith \"there is no foo_ctl formula\"" \
$(ECHO) "let foo_ctl () = failwith \"there is no foo_ctl formula\"" \
> test.ml

##############################################################################
Expand Down Expand Up @@ -685,7 +678,7 @@ distclean::
@$(MAKE) depend

depend: Makefile.config test.ml version
@echo constructing '.depend'
@$(ECHO) "Constructing '.depend'"
@rm -f .depend
@set -e; for i in $(MAKESUBDIRS); do $(MAKE) -C $$i depend; done
$(OCAMLDEP_CMD) *.mli *.ml > .depend
Expand All @@ -695,7 +688,7 @@ depend: Makefile.config test.ml version
##############################################################################

distclean::
@echo "cleaning configured files"
@echo "Cleaning configured files"
if test -z "${KEEP_CONFIG}"; then rm -f Makefile.config; fi
rm -rf autom4te.cache
rm -f config.status
Expand All @@ -706,7 +699,7 @@ distclean::
rm -f globals/regexp.ml python/pycocci.ml ocaml/prepare_ocamlcocci.ml
rm -f scripts/spatch.sh
rm -f aclocal.m4
@echo "run 'configure' again prior to building coccinelle"
@echo "Run 'configure' again prior to building coccinelle"


# don't include depend for those actions that either don't need
Expand Down
1 change: 1 addition & 0 deletions Makefile.config.in
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ PKG_CONFIG=@PKG_CONFIG@
INSTALL=@INSTALL@
TAR=@TAR@
PATCH=@PATCH@
ECHO=@ECHO@
PDFLATEX=@PDFLATEX@
PATCHELF=@PATCHELF@

Expand Down
26 changes: 22 additions & 4 deletions changes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@
- Support const/volatile after *. Thanks to Lars-Peter Clausen for
pointing out the problem.
- Support variable declarations in the first element of a for loop header.
- Support decimal type with the --ibm option
- Support some matching on pragmas

** Features:
- Preserve spacing before // comments when not at the beginning of a line
Expand Down Expand Up @@ -119,7 +121,7 @@
compiler and the C compiler and preprocessor).
- Add line number directives to the .ml file generated from a .cocci file
- Added 'make check' as an alternative to 'make test'. It can run after
building spatch, checks whether some featues work (python and ocaml scripts,
building spatch, checks whether some features work (python and ocaml scripts,
regexes) if these features are enabled, and then launches the test suite
with a 75% success rate requirement. It also does not ask for user input
and can be used in autonomous builds.
Expand All @@ -144,6 +146,8 @@
- Added support for c++ namespace syntax in cocci files.
- Improved c++ parsing
- Addition of gcc min and max operators. Thanks to Holden Karau
- Allow --use-idutils to take the name of the database as an optional
argument. Thank to Wolfram Sang for the suggestion.

** Bugfix:
- Corrected parsing of script strings delimited by a single quote. Thanks
Expand Down Expand Up @@ -267,6 +271,20 @@
- Allow an expression list metavariable to be attached to a parameter list
metavariable, to allow using the parameter names as an argument list.
Thanks to Michael Stefaniuc for pointing out the need for this feature.
- register x; in C is considered to implicitly declare an int typed
variable. A type metavariable that is part of a match of this
declaration will get bound to int. But if the type metavariable
furthermore is associated with a position metavariable, the match will
fail, because the implicit int has no position. Thanks to Nic Volanschi
for pointing out the problem.
- Propagate parameter list variables from rules for function definitions
to the generated rules for function prototypes. Thanks to Nic Volanschi
for pointing out the problem.
- Avoid introducing extra space when pretty printing. Thanks to Daniel
Wagner for pointing out the problem.
- Don't add extra space before semicolon, comma, or right paren when adding
an __attribute__
- Identifiers promoted to typedefs should have positions

* 0.2.5
** Language:
Expand Down Expand Up @@ -330,7 +348,7 @@
- matching of array initializations and of enum declarations

** Features:
- compatability with Python 2.7. Thanks to Richard W.M. Jones for pointing
- compatibility with Python 2.7. Thanks to Richard W.M. Jones for pointing
out the problem
- python and ocaml string representations of parameter lists and expression
lists
Expand Down Expand Up @@ -717,7 +735,7 @@
Thanks to Erik Hovland for an example that shows the problem.

** Internals:
- supress warning in compiling ocamlsexp (warning caused by a new behavior
- suppress warning in compiling ocamlsexp (warning caused by a new behavior
of cpp used internally in processing files in ocamlsexp/)

* 0.1.7
Expand All @@ -741,7 +759,7 @@
- allow . as the name of the directory
- for type inference for an assignment, take the type of the right-hand
side expression, not the type of the assigned variable
- allow for with a declartion in the first header element, as in C++
- allow for with a declaration in the first header element, as in C++
(partial support)
- allow for matching against variable declarations that include only
storage, eg static, but no type at all.
Expand Down
Loading

0 comments on commit a746521

Please sign in to comment.