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