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