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