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