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