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