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