Release coccinelle-0.2.2
authorCoccinelle <cocci@diku.dk>
Sun, 3 Oct 2010 12:03:48 +0000 (14:03 +0200)
committerRene Rydhof Hansen <rrh@cs.aau.dk>
Sun, 3 Oct 2010 12:03:48 +0000 (14:03 +0200)
** Language:
   - Added ToTestExpression to iso language, see standard.iso for an
     explanation
   - Added depends on to initialize and finalize script code

** Features:
   - Update Emacs mode (cocci.el) to support 'virtual' rules and fix other
     keywords sush as 'depends on', 'using', 'disable'
   - better treatment of != 0 in isos, communtativity for ==/!= for all
     constants
   - allow adding // comments and blank lines (even after cocci + code)
   - Add support for multiple -I options

** Bugfix:
   - correct interaction between virtual rules and included .cocci files
   - improvement in treatment of ! in isos, to avoid duplicating + code
   - improvement in treatment of metavars as isos, to avoid duplicating + code
     between toplevel and variable instantiation
   - test expression of smpl conditional, etc no longer assumed to have type
     int
   - correct + line numbers in the patch produced when using *
   - iso constant metavariable matches an identifier whose name is all capital
     letters, eg NULL
   - allow / at the end of the name of a directory (-dir) or patch prefix
     (-patch)
   - dropped space in + code after the binding of a type metavariable that is
     a pointer type
   - better handling of . or .. in -dir name
   - allow keywords and metavariable names in identifier constraints (not sure
     keywords is very useful, though)
   - no lubtype on arguments of && and || in SmPL
   - allow unknown as type for array indices in SmPL
   - support matching of static annotation on functions that are both static
     and inline
   - support ENOTDIR error in Common.lfile_exists, to allow for the case where
     an include file is in a subdirectory that exists but is an ordinary file,
     not a directory.
   - better management of unbound position variables that appear in
     constraints
   - cause python parser to skip over // comments, hoping that // is not
     meaningful inside python
   - require + on every line of a multiline comment
   - correct calculation of line numbers when there is script code
   - always annotate arguments of && || and ! as test expressions in C code.

changes.txt
commitmsg
docs/manual/main_grammar.pdf
docs/manual/manual.pdf
docs/manual/options.pdf
globals/config.ml.in
parsing_c/type_annoter_c.ml
test.ml
tests/na.c [new file with mode: 0644]
tests/na.cocci [new file with mode: 0644]
tests/na.res [new file with mode: 0644]

index 78afb2b..cd6ec9f 100644 (file)
@@ -56,7 +56,8 @@
 - cause python parser to skip over // comments, hoping that // is not
   meaningful inside python
 - require + on every line of a multiline comment
-- correct caluation of line numbers when there is script code
+- correct calculation of line numbers when there is script code
+- always annotate arguments of && || and ! as test expressions in C code.
 
 * 0.2.1
 ** Language:
dissimilarity index 98%
index b443914..c522439 100644 (file)
--- a/commitmsg
+++ b/commitmsg
@@ -1,3 +1,46 @@
-Release coccinelle-0.2.2-rc2
-
-Release Candidate 2 for coccinelle-0.2.2
+Release coccinelle-0.2.2
+
+** Language:
+   - Added ToTestExpression to iso language, see standard.iso for an
+     explanation
+   - Added depends on to initialize and finalize script code
+
+** Features:
+   - Update Emacs mode (cocci.el) to support 'virtual' rules and fix other
+     keywords sush as 'depends on', 'using', 'disable'
+   - better treatment of != 0 in isos, communtativity for ==/!= for all
+     constants
+   - allow adding // comments and blank lines (even after cocci + code)
+   - Add support for multiple -I options
+
+** Bugfix:
+   - correct interaction between virtual rules and included .cocci files
+   - improvement in treatment of ! in isos, to avoid duplicating + code
+   - improvement in treatment of metavars as isos, to avoid duplicating + code
+     between toplevel and variable instantiation
+   - test expression of smpl conditional, etc no longer assumed to have type
+     int
+   - correct + line numbers in the patch produced when using *
+   - iso constant metavariable matches an identifier whose name is all capital
+     letters, eg NULL
+   - allow / at the end of the name of a directory (-dir) or patch prefix
+     (-patch)
+   - dropped space in + code after the binding of a type metavariable that is
+     a pointer type
+   - better handling of . or .. in -dir name
+   - allow keywords and metavariable names in identifier constraints (not sure
+     keywords is very useful, though)
+   - no lubtype on arguments of && and || in SmPL
+   - allow unknown as type for array indices in SmPL
+   - support matching of static annotation on functions that are both static
+     and inline
+   - support ENOTDIR error in Common.lfile_exists, to allow for the case where
+     an include file is in a subdirectory that exists but is an ordinary file,
+     not a directory.
+   - better management of unbound position variables that appear in
+     constraints
+   - cause python parser to skip over // comments, hoping that // is not
+     meaningful inside python
+   - require + on every line of a multiline comment
+   - correct calculation of line numbers when there is script code
+   - always annotate arguments of && || and ! as test expressions in C code.
index 3c125f7..b64df05 100644 (file)
Binary files a/docs/manual/main_grammar.pdf and b/docs/manual/main_grammar.pdf differ
index 6813f62..54b13f6 100644 (file)
Binary files a/docs/manual/manual.pdf and b/docs/manual/manual.pdf differ
index 0d1a436..9eb276d 100644 (file)
Binary files a/docs/manual/options.pdf and b/docs/manual/options.pdf differ
index ca5f236..f1b8fd4 100644 (file)
@@ -1,4 +1,4 @@
-let version = "0.2.2-rc2"
+let version = "0.2.2"
 
 let path =
   try (Sys.getenv "COCCINELLE_HOME")
index 60c504d..a55753a 100644 (file)
@@ -1259,7 +1259,10 @@ let annotate_test_expressions prog =
     Visitor_c.kexpr = (fun (k,bigf) expr ->
       (match unwrap_expr expr with
        CondExpr(e,_,_) -> propagate_test e
-      |        _ -> ()
+      |        Binary(e1,Logical(AndLog),e2)
+      | Binary(e1,Logical(OrLog),e2) -> propagate_test e1; propagate_test e2
+      | Unary(e1,Not) -> propagate_test e1
+      | _ -> ()
       );
       k expr
     );
diff --git a/test.ml b/test.ml
index 8ee1f16..6d67c2f 100644 (file)
--- a/test.ml
+++ b/test.ml
  *)
 
 
+(*
+ * Copyright 2005-2010, Ecole des Mines de Nantes, University of Copenhagen
+ * Yoann Padioleau, Julia Lawall, Rene Rydhof Hansen, Henrik Stuart, Gilles Muller, Nicolas Palix
+ * This file is part of Coccinelle.
+ *
+ * Coccinelle is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, according to version 2 of the License.
+ *
+ * Coccinelle is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Coccinelle.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * The authors reserve the right to distribute this or future versions of
+ * Coccinelle under other licenses.
+ *)
+
+
 (*
  * Copyright 2005-2009, Ecole des Mines de Nantes, University of Copenhagen
  * Yoann Padioleau, Julia Lawall, Rene Rydhof Hansen, Henrik Stuart, Gilles Muller, Nicolas Palix
diff --git a/tests/na.c b/tests/na.c
new file mode 100644 (file)
index 0000000..bdbbe3c
--- /dev/null
@@ -0,0 +1,13 @@
+#define FOO 10
+
+void foo()
+{
+  int i;
+
+  if (!i &  FOO) return;
+  !i & -FOO;
+  !i & !FOO;
+  !i &  100;
+  !i & -100;
+  !i & !100;
+}
diff --git a/tests/na.cocci b/tests/na.cocci
new file mode 100644 (file)
index 0000000..cc1544b
--- /dev/null
@@ -0,0 +1,7 @@
+@r @
+expression E;
+constant C;
+@@
+
+- !E & C
++ 12
diff --git a/tests/na.res b/tests/na.res
new file mode 100644 (file)
index 0000000..7528e1b
--- /dev/null
@@ -0,0 +1,13 @@
+#define FOO 10
+
+void foo()
+{
+  int i;
+
+  if (12) return;
+  12;
+  !i & !FOO;
+  12;
+  12;
+  !i & !100;
+}