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