3 * upcoming/planned/todo
5 - Semantic patch for other languages
6 - Support metavariables, virtual rules and virtual identifiers
7 in initialize and finalize rules
10 - New scripting languages
13 - Add more information in documentation, man pages and wiki
18 - Make a very small attempt to parse C++ code, amounting to accepting
19 identifiers containing ::, tilde, and template invocations. Use the
20 option -c++. This is not likely to be very useful in practice.
23 - support transformations on variables (only) in declarations that declare
25 - allow #endif XXX in C code
26 - relax_include_path now applied to non local includes too, in which case
27 it tries to find a unique file with a suffix of the provided name.
28 this is useful for directories that are intended to be symbolic links.
29 - support matching and removing #undef
30 - support for iteration in ocaml, requires use of -no_show_diff
31 - calls to likely and unlikely propagate test expression status to their
35 - improved parsing of expressions to allow ... to the right of operators in
40 - scripts now have names and can declare metavariables that are seen by
41 SmPL as identifier metavariables, see demos/{python,ocaml}tococci.cocci
42 - declaration (match variable declarations) and field (match structure
43 field declarations) metavariables
44 - matching of array initializations and of enum declarations
47 - compatability with Python 2.7. Thanks to Richard W.M. Jones for pointing
49 - python and ocaml string representations of parameter lists and expression
51 - try simpler patterns on glimpse failure
52 - graceful and immediate failure when a virtual rule is defined on the
53 command line, but not in the rule
54 - spatch returns -1 when a virtual rule is requested that is not supported
55 - no transformation when using * with the option -no_show_diff
56 - expanded +++ file name for match output
57 - struct *^* and enum *^* metavariable types
58 - allow an assignment to match a variable initialization, even if multiple
59 variables are declared at the same time.
60 - add the option -recursive_includes
61 - added the option -use_idutils. The requires the previous use of the
62 script idutils_index.sh
65 - detect used after metavariables in simple statement metavariable match
66 - allow inheriting position variables over rules that make transformations
67 but depend on virtual rules that are not defined on the command line
68 - treat top-level tokens in decl visitor. Thanks to Peter Tummeltshammer
69 for noticing a resulting problem.
70 - improve typing of the result of an assignment expression
71 - eliminate some recursive calls in C code parsing to avoid stack overflows
72 - better pretty printing of #define when the whole line is removed
73 - better pretty printing of asm code containing
74 "::[input]"r"(&coherence_data[i])"
75 - allow pretty printing of C code with nameless bit fields
76 - avoid adding an error message to standard output if ocamlfind is not
78 - struct/union/enum-typed metavariables with a metavariable type name
79 - better management of whitespace between deleted lines. Thanks to
80 Andriy Gapon for noticing the problem.
81 - improved parsing recovery for badly parsed struct/enum typedefs
82 - drop expanded tokens in sgrep output. Thanks to Andriy Gapon for
84 - constant strings have array type, not pointer type. Thanks to Vasiliy
85 Kulikov for noticing the problem.
86 - improve indentation when adding code after a function call with indented
88 - return type of sizeof converted to unsigned long. Thanks to Vasiliy
89 Kulikov for noticing the problem.
90 - improve spacing when adding structure initializers. Thanks to Vasiliy
91 Kulikov for noticing the problem.
95 - <= constraints relating an expression metavariable to one or more
96 inherited expression metavariables that it should be a subexpression of
97 - the -inplace and -outplace options have been renamed -in_place and
98 -out_place. -in_place no longer makes a backup. A backup can be
99 requested using the option -backup_suffix, eg -backup_suffix .bk
100 - identifiers can be constrained to be different from an inherited
101 identifier metavariable, or from a set containing both concrete
102 identifiers and inherited identifier metavariables.
103 - support for ocaml scripting
104 - ast available in ocaml scripts
107 - drop inconsistent paths check when only one node was matched
108 - allow #define id with no definition
109 - attempt to add newlines in the generated code when function calls in the
110 smpl cause passing column 80
111 - allow - in front of statement level nests, if everything inside the nest
113 - 'configure' looks for some system libraries: menhirLib, sexplib, pycaml.
114 Not available libraries are replaced by a copy provided with the sources.
115 - added static for a function goes just before what is specified in the
116 semantic patch, not before any comments etc.
117 - Add a new option, -ignore_unknown_options, to ease the integration
118 of Coccinelle as a checker in a toolchain.
119 - error in python code causes immediate abort of spatch
120 - use the same algorithm for collecting grep tokens as for collecting
122 - Add scripts/spatch.bash_completion for automatic completion of common
123 options under the bash shell.
124 - Print rule name when a script rule crashes
125 - Allow the declaration of an expression list or parameter list
126 metavariable to specify the number of expressions or parameters,
130 - drop inconsistent paths check when only one node was matched
131 - better take into account virtual rules when selecting glimpse tokens
132 - print diff when only a comment is added
133 - the type of the C code !x should be int regardless of the type of x
134 - allow python code at the beginning of an included file
135 - better adjustment of whitespace when deleting adjacent lines. Thanks to
136 Wolfram Sang for pointing out the problem.
137 - allow metavariables to be inherited from included files
139 - more graceful failure on finding a strange character in a macro parameter
141 - support Parameter metavariables
142 - add space after the last comma in an added portion of an argument list
143 - SmPL nameless struct should only match a nameless struct, not a nameless
144 union. Thanks to Peter Tummeltshammer for pointing out the problem.
145 - adjustments to storage don't modify inline as well
146 - matching and transformation allowed on inline
147 - allow removed field between two ... in structure initialization
148 - allow removing an entire structure initialization
149 - manage labels within do while 0 macros
150 - added space after : in printing a conditional expression. Thanks to Josh
151 Triplett for noticing the problem.
152 - dropped trailing whitespace when code at the end of a line is deleted.
153 Thanks to Josh Triplett for noticing the problem.
154 - Fixed environment management when script rule uses cache. Thanks to
155 Bissyande for finding the problem.
156 - when false matches if with no else
157 - ensure { ... } with whencode checks to the end of the function. Thanks to
158 Rene Rydhof Hansen for finding the problem.
162 - Added ToTestExpression to iso language, see standard.iso for an
164 - Added depends on to initialize and finalize script code
167 - Update Emacs mode (cocci.el) to support 'virtual' rules and fix other
168 keywords sush as 'depends on', 'using', 'disable'
169 - better treatment of != 0 in isos, communtativity for ==/!= for all
171 - allow adding // comments and blank lines (even after cocci + code)
172 - Add support for multiple -I options
175 - correct interaction between virtual rules and included .cocci files
176 - improvement in treatment of ! in isos, to avoid duplicating + code
177 - improvement in treatment of metavars as isos, to avoid duplicating + code
178 between toplevel and variable instantiation
179 - test expression of smpl conditional, etc no longer assumed to have type
181 - correct + line numbers in the patch produced when using *
182 - iso constant metavariable matches an identifier whose name is all capital
184 - allow / at the end of the name of a directory (-dir) or patch prefix
186 - dropped space in + code after the binding of a type metavariable that is
188 - better handling of . or .. in -dir name
189 - allow keywords and metavariable names in identifier constraints (not sure
190 keywords is very useful, though)
191 - no lubtype on arguments of && and || in SmPL
192 - allow unknown as type for array indices in SmPL
193 - support matching of static annotation on functions that are both static
195 - support ENOTDIR error in Common.lfile_exists, to allow for the case where
196 an include file is in a subdirectory that exists but is an ordinary file,
198 - better management of unbound position variables that appear in
200 - cause python parser to skip over // comments, hoping that // is not
201 meaningful inside python
202 - require + on every line of a multiline comment
203 - correct calculation of line numbers when there is script code
204 - always annotate arguments of && || and ! as test expressions in C code.
208 - Add virtual identifiers
209 - Add coccilib.report and coccilib.trac Python modules
210 - coccilib.org and coccilib.report are imported by default but not loaded
211 in the current scope.
214 - Parse_error_msg now more helpful. New option -verbose_parsing for even
216 - Improve Python import handling. They are imported once during script
220 - correct treatment of depends on with || for virtual rules
226 - Remove duplicated code in disjunctions
227 - Better error message when grep finds nothing relevant. Thanks to Joe
228 Perches for the suggestion.
229 - added -keep_comments option for the unparsing of the transformed code
230 - Option "-version" now also gives information about built-in
231 Python binding support.
232 - slightly faster environment manipulation in pathological cases
233 - hack added to accept well-formed #define after function header
236 - Proper consideration of #define macro arguments in checking for the use
237 of metavariables and in computing the line numbers of complex terms
238 - Better parsing of included .cocci files
239 - Put included .cocci files in the right order
240 - Bind position variables only once for #include
241 - Fix bug in include_match that caused everything to halt when all matches
243 - Merge unlikely/likely iso rules under a iso rule named unlikely
244 - Some fixes to coccicheck rules, thanks to Andrew Lunn
245 - Support groups in regular expression, thanks to Michael Stefaniuc
250 - Meta-identifier/function and constant could be filtered from SmPL by
251 regular expressions using the "~=" and "!~=" operators followed by
252 an OCaml regular expression (see man Str) in double quote.
253 - Virtual rules, which can be referenced in depends, and set and unset
254 using the command-line options -D
255 - ++ for multiple additions
258 - coccicheck: a framework to check a series of SmPL files on a project
259 see scripts/coccicheck for more information
262 - bind position variables to the correct starting position in the case of a
263 complex statement such as an if or while. Thanks to Derek Jones for
264 pointing out the problem.
265 - checking for non mentioned case lines in switch should be unchecked.
266 - space should be printed after sizeof when there are no parentheses around
267 the argument. Thanks to Daniel Walker for pointing out the problem.
268 - avoid introducing sharing in propagating ! over () in treatment of isos
269 - save_excursion has to handle and rethrow exceptions
270 - eliminate unnecessary consideration of CVS strings. Thanks to David
271 Young for pointing out the problem.
272 - completely new treatment of statement metavariables
273 - better type checking for macro definitions
274 - drop regression testing in -parse_c
279 - declarations allowed in switch, suggested by Derek M. Jones
282 - use interval timer for timeouts. Thanks to Derek M. Jones for the
284 - more flexible env.sh, thanks to Derek Jones.
285 - faster Python invocation
286 - simplify unparsing in the sgrep case
289 - for glimpse there is no point to create a pattern containing a numeric
290 constant because glimpse doesn't index them
291 - add spaces after commas in function calls and function headers
292 - made python integration more like the ubuntu version
293 http://patches.ubuntu.com/by-release/extracted/debian/c/coccinelle/0.1.5dbs-2/01-system-pycaml
294 this fixes some memory management problems with None, True, and False
295 - correct labels associated with a switch in the CFG so that a statement
296 metavariable can match a switch. Thanks to Derek Jones for pointing out
298 - keep switch pattern within switch body. Thanks to Derek Jones for
299 pointing out the problem.
300 - Allow expanded tokens to be stored in metavariables, as long as they are
301 not removed. But this does currently allow them in + code, which will
302 produce the expansion. Thanks to Ali-Erdem Ozcan for pointing out the
304 - improved adjustment of spacing when code removed at the beginning of a line
309 - allow fresh identifiers to be declared using ## such that the value mixes
310 both strings and previously declared metavariables
313 - better handling of expanded code containing ##. Now compute the
315 - more precise warning message for the "'\' outside define".
316 Thanks to Nicholas Mc Guire for pointing out the problem.
317 - more precise warning message related to ifdefization.
318 Thanks to Derek Jones for pointing out the problem.
319 - we don't create any more certain files in /tmp (they may be a cause
320 of security problems).
321 Thanks to Eugeniy Meshcheryakov for pointing out the problem.
322 - More optimization for the case of just deleting a complete function.
323 Allows this to happen without tracing through all the control-flow
324 paths. Thanks to Francois Bissyande for pointing out the problem.
325 - prevent code from being added to the beginning or end of a disjunction
326 - more information about why a script is not applied when using -debug option
327 - added -no_safe_expressions option
328 - added -no_loops option. Ignores back edges derived from looping
329 constructs. This is unsafe, but perhaps useful for bug finding, as it can
331 - for semantic matches, allow "minus" on same code with multiple
333 - better error message for mismatch of parenthesis in column 0 with normal
334 parenthesis. Thanks to Derek Jones for pointing out the problem.
335 - allow disjunctions on function return types. Thanks to Pierre Habouzit
336 for pointing this out.
339 - keep disjunction in the proper order for structure initialization fields
340 - variables declared in different places should not seem to match each
342 - drop complaints about label metavariables not being used
343 - drop test information from the type of an expression when the expression
344 is bound to a metavariable
345 - nests should not extend beyond the before and after code, even if the
346 before and after code matches the nest code
347 - nests should extend into conditionals that end in error exit
348 - take into account metavariables on "else". Thanks to Derek Jones for
349 pointing out the problem.
350 - print single quotes on generated character constants
351 - better typedef handling in the initialisation/affectation builtin
352 isomorphism, cf -test init_affect_typedef
353 - support disjunction of types on variable declaration
354 - allow @ within strings in script code. ignore // comment lines in script
356 - don't drop + code placed after the transformed code
357 - drop spaces produced by removing code before semicolons
358 - adjusted spacing within generated code
359 - less verbose -sp. Thanks to Derek Jones for pointing out the problem.
360 - accept multiple type names in a SmPL typedef declaration.
367 - Metavariables now capture the cpp code contained within their definitions
368 - When - fragments are separated by ... or nest boundaries in the semantic
369 patch, but end up matching adjacent source code, the comments, cpp code
370 and whitespace that are between them are not deleted.
371 - better parsing of C: do expansion of macros only when needed when
372 have actually a parse error and also leverage the definition of macros
373 in the parsed file (or in a optional_standard.h file passed as a parameter).
374 This should reduce the need for many hardcoded definitions in standard.h
375 - new semantics for the -macro_file option, by default now expand macros
376 only when necessary. To force use the -macro_file_builtins option instead.
377 - a new -extract_macros command line action to help the parser. Works with
378 the -macro_file option. e.g.
379 $ ./spatch -extract_macros ~/linux > /tmp/alldefs.h
380 $ ./spatch -macro_file /tmp/alldefs.h -sp_file foo.cocci -dir ~/linux
381 - removed -D macro_file option, not consistent with what -D usually means
382 - reattempt to be more efficient for statement metavariables that are just
383 placeholders (ie, no modification, no reuse)
384 - triples now returned from ctl in sorted order. The main key is the
385 state. On the other hand, the state order does not always agree with the
386 order of appearance in the code.
387 - spatch is now less verbose on the things it does yet handle. Less confusing
389 - slightly better error report. Thanks to Derek Jones for the suggestion.
390 - added the options -linux_spacing and -smpl_spacing. -linux_spacing
391 causes spatch to follow the spacing conventions of Linux, while
392 -smpl_spacing causes spatch to follow the spacing in the semantic patch.
393 -linux_spacing is the default.
394 - more informative error reporting for the already tagged token case.
395 Thanks to Erik Hovland for the suggestion.
398 - better parsing of declare macro at toplevel and in structure.
400 - allowing back typedef names for fieldname
401 - better printing of else in generated code
402 - slightly better type inference for binary operators.
403 - clear out declarer names and iterator names between SmPL files (for
405 - better parsing and type checking of macro type aliases. Cf -test macro_int16.
406 Thanks to Li Yingtong for pointing out the problem.
407 - make insert_virtual_positions tail rec, avoid stack overflow pb.
408 Thanks to Diego Liziero <diegoliz@gmail.com> for pointing out the
410 - Better type inference for arithmetic binary operators
411 Thanks to Li Yingtong for pointing out the problem.
412 - Better type inference for constants
413 Thanks to Li Yingtong for pointing out the problem.
414 - move computing of adjacency information for semantic patches to after
415 application of isomorphisms, because isomorphisms can introduce "..."
416 - compute adjacency information for negated ...
417 - record with each transformation site the set of indices of the witness
418 trees that caused the transformation site to come about. Whitespace and
419 comments between remove tokens associated with disjoint witness trees is
421 - correct treatment of function pointer typed parameters in the SmPL ast0
423 - better parsing error message and error recovery when comments are not ended,
424 when some macros have a weird body, and when some switch have a weird
426 Thanks to Derek Jones for pointing out the problem.
427 - better detection and passing of "dangerous" ifdefs, cf -test
429 - dropped the separation of decls and body in Seq. This gives better
430 positioning of the bindings of metavariables shared between them.
431 Thanks to Erik Hovland for an example that shows the problem.
434 - supress warning in compiling ocamlsexp (warning caused by a new behavior
435 of cpp used internally in processing files in ocamlsexp/)
440 - initialize and finalize script code, cf demos/initial_final.cocci
443 - -iso_limit option to limit the depth of isomorphism application
444 - with the dir option, the include path is implicitly set to the "include"
445 subdirectory of the specified directory, if the option -I is not used.
446 - give a seed for the name of a fresh identifier
447 - better handling of cpp "constructed" identifiers as in a##b, that in
448 the futur will make it easier to match over those idents.
449 cf tests/pb_parsing_macro.c. Thanks to Ali-Erdem Ozcan for pointing
450 out the problem. A new "parsing hack hint" is also available:
451 YACFE_IDENT_BUILDER, cf standard.h.
454 - drop excessive "optimization" in ctl generation for while and for loops
455 - allow . as the name of the directory
456 - for type inference for an assignment, take the type of the right-hand
457 side expression, not the type of the assigned variable
458 - allow for with a declartion in the first header element, as in C++
460 - allow for matching against variable declarations that include only
461 storage, eg static, but no type at all.
462 - allow for matching against types that contain both short/long and int
463 - allow the type metavariable in the SmPL code "unsigned T" to match a T
464 that is a type consisting of more than one word, eg long int.
465 - -ifdef_to_if option made to process nested ifdefs
469 - improve and fix installation process (usable on BSD)
470 - improve and fix testing process
471 - apply patches from Eugeniy Meshcheryakov
472 - reorganize the way we parse C identifiers, especially concatenated cpp
473 identifiers as in a##b. This may lead to some regressions as we may
474 not parse as much code as before.
475 - removed popl/ and popl09/ and popl related stuff from official distrib.
480 - the ability to add comments
483 - grouping of generated rules with -hrule option
484 - handling of special coccinelle comments
485 /* {{coccinelle:skip_start}} */ and
486 /* {{coccinelle:skip_end}} */
487 allowing to give more hints to the C parser.
488 Thanks to Flavien@lebarbe.net for the idea.
489 - the ability to print the values of more (but not all) kinds of
490 metavariables from python
492 Thanks to Alexander Faroy.
495 - consider the ident tokens also in the 2 lines before the error line for the
496 10-most-problematic-parsing-errors diagnostic.
497 - SmPL parser allows cast as the argument of a pointer
498 - SmPL type checker allows enum as an array index
499 - Better generation of fresh metavariables names in hrule
500 - no more warnings about things that should be metavariables when there is
501 a disjunction in a function position
502 - bugfix in parser, better error message.
503 Thanks to Ali-Erdem OZCAN <ali-erdem.ozcan@st.com> for the bug report.
510 - added initialiser metavariable
511 - added sequences of designators in structures
514 - improved printing of the C code corresponding to metavariables
515 - improved printing when code (eg declarations) is removed at the beginning
516 of a block, and then is followed by a blank line
517 - slightly less verbose error reporting in parsing_hacks
520 - fixed some problems with parsing SmPL code where a nest appears after a |
521 - better treatment of { }, form in macros wrt unparse_c
522 - less quiet for -parse_c
523 - improve parsing heuristics regarding macro statement
530 - long long added to SmPL
533 - add grammar reference and spatch command line options reference
536 - can match patterns of the form unsigned T or signed T, where T is a
538 - dropped the sizeof_parens isomorphism, which was made redundant by the
540 - simple rule generation
543 - trailing , ; and ) no longer left on a line by themselves
544 - better treatment of error exit when the searched for code matches the
545 error exit condition.
546 - fix incorrect treatment of parentheses in test_exps that could allow +
547 code to be added twice
548 - don't ask whether iterator names and declarer names should be declared as
550 - slightly better support for expression list metavariables.
551 - short and long allowed for array index types in SmPL
552 - more restrictions on type inference for pointer arithmetic in SmPL
553 - allow isomorphisms to apply when + code is anywhere within all - terms
554 - changed order of printing const and volatile
555 - allow eg ... <... in plus code
556 - better formatting of generated if/while/etc. code
557 - better parse error reporting when the problem is at the end of the file
560 - isomorphisms don't apply under signed/unsigned, to prevent the creation
561 of things like unsigned signed int. Need a better solution for this.
566 - help in building the configuration macro file. The -parse_c action
567 now returns the 10 most frequent parsing errors. This give useful
568 hints to extend standard.h.
571 - positions no longer allowed on \(, \|, and \)
572 - improved propagation of negation for isos in the presence of parens
573 - convert Todos in flow graph construction to recoverable errors
574 - fixed bug in treatment of when != true and when != false, to allow more
575 than one of them per ...
576 - improve parsing of typedef of function pointer.
578 - parsing and typing support for old style C function declaration.
579 - consider position variables as modifications when optimizing the
580 translation into CTL of function definitions
587 - better handling of ifdef on statements in control flow graph.
588 - transform files even if they do not end in .c (thanks to Vegard Nossum)
591 - merge code of yacfe
596 - support for initializer at toplevel, cf -test substruct
600 ** first public release of the source code:
603 - embeded python scripting
610 ** first public release of the binary
615 - lots of features ... look at coccinelle research papers and tutorials.