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