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