Coccinelle release 1.0.0-rc13
[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
ca417fcf 8- Support for matching #ifdef, etc.
190f1acf 9- function-typed metavariables
993936c0
C
10- virtual typedef, declarer name, iterator name
11- regexps for type metavariables
97111a47 12- 'symbol' metadeclaration for C identifiers that are guaranteed not intended as meta variables.
55d38388
C
13
14** Features:
15- New scripting languages
993936c0 16- more than one SP on the command line
55d38388
C
17
18** Bugfix:
19- Add more information in documentation, man pages and wiki
993936c0
C
20- typedefs from C code should not be used before their point of inference
21 (saved_typedefs in cprogram_of_file)
55d38388 22
8f657093
C
23* 1.0.0
24** Language:
25- Addition of initializer list metavariables. Thanks to Michael Stefaniuc
26 for noticing the need for them.
27- Allow multiple position variables per token
8babbc8f
C
28- ++ can now be associated with - code
29- Allow /* */ comments as smpl comments, not only as + code
30- Add support for && (label addresses)
31- local idexpression metavariable no longer matches static local x
5427db06 32- Consider using to be a comment in C++ code. Patch submitted by Jani Monoses.
993936c0
C
33- Command line cocci
34- print_main etc for ocaml Coccilib
f3c4ece6 35- =~ not ~= is used to indicate a regular expression constraint on an
7fe62b65 36 identifier. And !~ for a nonmatch.
f3c4ece6 37- allow long double, short int, long int, and long long int in SmPL code.
7fe62b65
C
38- gcc constructors allowed in SmPL. Thanks to Uwe Kleine-Koenig for
39 pointing out the problem.
97111a47
C
40- Allow ! to appear before () in depends. Thanks to SF Markus Elfring for
41 noticing the problem.
42- Can add code containing #pragma or #line.
17ba0788
C
43- Multicharacter command-line options now begin with -- and contain -
44 rather than _.
45- Allow multiple types of hidden metavariables, each preceded by @.
46 Position variables can be attached to these.
47- Python code now receives a structure containing a list of matched
48 elements for list metavariables. Thanks to Michael Stefaniuc for
49 suggesting this features.
50- Python code now receives expressions and identifiers as ordinary strings,
51 not as elements of specific structures.
d6ce1786
C
52- Allow size_t as the type of an array index in smpl code. Reported by
53 Mansour Moufid.
54- Allow exp@id
55- Allow renaming an expression as an identifier (@i)
8f657093
C
56
57** Features:
58- Preserve spacing before // comments when not at the beginning of a line
8babbc8f
C
59- Adjusted parsing of endif to put it after jump code
60- Improve warning message when using -use_cache
8babbc8f
C
61- More helpful initial value for exported variables in python
62- Support - on expression nests
65038c61
C
63- Better handling of the case of a matched declaration that should only
64 be replaced by other top level things.
5427db06
C
65- Allow a semantic patch beginning and ending with braces to match the
66 complete body of a function if the braces are not removed and if nothing
67 is added before the first brace or after the last one.
68- Add -cache_prefix option, to specify where to put cached files.
69- Allow module_init(foo); to match module_init(foo) (or likewise for any
70 declarer), when no transformation is specified on the semicolon.
71- Add Coccilib.exit() for ocaml code and cocci.exit() for python code,
72 to abort the treatment of the current file.
993936c0
C
73- Don't multiply print the same patch for the same file
74- Drop date in diff
75- Don't repeat smpl type warnings
76- -sp_file/-cocci_file are now optional. If not present an argument that
77 ends in .cocci is assumed to be the name of the file containing the
78 semantic patch.
f3c4ece6
C
79- Allow limiting the size of a named cache using -cache_limit
80- Cache name specified with -cache_prefix is extended according to the
81 index (parallelism), if any.
82- Allow multi-character constants in C code and SmPL code. Thanks to Kamil
83 Pilch for pointing out the problem.
97111a47
C
84- Better parsing of K&R C functions. No longer convert all parameters to
85 typedefs.
86- Implement newes as a hash table, for more efficiency on big sets of
87 environments.
88- A local variable that is declared without a type is not considered to be
89 a local variable. Actually, such a variable is probably really a macro
90 that expends to a declaration, and this macro is not the variable name.
91- Allow iteration to make modifications when the modifications are done
92 inplace.
93- -debug gives information about defined virtual rules and about virtual
94 identifier bindings.
95- no more crashing on c++-like code without the c++ argument.
96- dependencies can have ! on ()
97- Give ocaml code access to Flag and thus the current file name.
17ba0788
C
98- Slightly more efficient handling of lists.
99- Slightly better error message in the case of inconsistent paths
100- Improve limited size caching
d6ce1786
C
101- Remove zero #ifdefs when everything else is removed
102- Mac OSX compatibility (tested on OSX Lion)
103- 'Make depend' is called automatically when starting from a cleaned source
104- Configure flag --enable-release makes 'make' build the optimized version of
105 coccinelle if possible.
106- The installed 'bin/spatch' calls spatch.opt or spatch with default parameters
107 for iso/headers/python. 'bin/spatch.opt' and 'bin/spatch.byte'
108- The bundled packages are now in the 'bundles' subdirectory and in the
109 form of their original tarballs. These are extracted and used on-demand.
110- Compatibility with python 2 and python 3. Also, a small bug is fixed in the order
111 of library includes that caused sometimes trouble when building the pycaml library.
112- Dropped the dependency on Perl in the Makefiles
113- The configure script uses pkg-config and ocaml findlib and provides many
114 flags for tuning/overriding the build process (including the ocaml
115 compiler and the C compiler and preprocessor).
116- Add line number directives to the .ml file generated from a .cocci file
117- Added 'make check' as an alternative to 'make test'. It can run after
118 building spatch, checks whether some featues work (python and ocaml scripts,
119 regexes) if these features are enabled, and then launches the test suite
120 with a 75% success rate requirement. It also does not ask for user input
121 and can be used in autonomous builds.
122- Added an experimental --reverse flag to invert the semantic patch before application.
123 Note that not all patches can be inverted, nor is it guaranteed that applying
124 a patch followed by applying its inverse is an identity operation.
8f657093
C
125
126** Bugfix:
127- Corrected parsing of script strings delimited by a single quote. Thanks
128 to Eugeniy Meshcheryakov for reporting the problem.
129- Improved indentation of added ifdefs.
130- Allow added comments and #ifdefs to precede other added code. Thanks to
131 Jani Monoses for noticing the problem.
8babbc8f
C
132- Corrected failure to due missing ocamlfind. Thanks to Derek M. Jones for
133 reporting the problem.
134- Allow fake nodes to be - in the allminus case, to drop tokens related to
135 a function definition or forward declaration but before the first code
136 mentioned in the semantic patch.
137- Drop __init etc when deleting a whole function.
138- Cause appropriate newlines to be preserved when multiple matches (trees)
139 contain adjacent modifications derived from the same SmPL code.
140- check_meta takes into account fresh identifier seed information.
141- Types for worth-trying optimization should not be followed by space
65038c61
C
142- Improved filtering of result of matching atomic patterns
143- Drop positions before creating function prototype rules
144- Adjust position of { introduced by adding multiple statements in a
145 single-statement position
146- Drop newline after function call ( when all arguments on that line are
147 eliminated
148- Accept removal of a single declaration, replaced by arbitrary,
149 non-declaration code
150- smpl_spacing takes into account newlines, indentation
5427db06
C
151- Improved prevention of transformations on toplevel { ... } from causing
152 changes outside function boundaries; also outside ifs, whiles, etc.
153 Changes are still allowed on { ... } present for other reasons.
154- Fix bug in include_match that caused everything to halt when all matches
155 were discarded
993936c0
C
156- Don't call Insert_plus on rules that cannot be evaluated due to failed
157 dependencies.
158- Allow variable declaration right after a case in switch.
159- The top of a loop is also after the body of a loop, for ... in loop body
160- Do not anchor Str regexp at the beginning of the string to check
161- Type annotation for C code uses most recent env for typedefs when
162 possible. Thanks to Andrea Canciani for pointing out the problem.
163- Pretty print pointer types without a trailing space. Thanks to Michael
164 Stefaniuc for pointing out the problem.
f3c4ece6
C
165- Propagate dependencies further in get_constants2
166- Make lexer more dos friendly
97111a47
C
167- slightly better handling of long long
168- Strip constraints from metavariables in function prototype treatment
169 before comparison, due to incomparability of pcre regexps.
170- Fixed obsolete regexp doc, thanks to Dmitry Osmakov
171- Improved x || ... || y to avoid double modification
172- Transparently allow \( \| and \) to be on lines beginning with -. The -
173 has no effect.
174- Remove memory leak related to pr2_once management. Thanks to Robert
175 Gomulka for helping to solve the problem. Don't use once hashtable if
176 messages won't be printed anyway.
177- Change the type of subtraction mixing pointer and array to have int result.
178 Thanks to Robert Gomulka for noticing the problem.
179- Fix interpretation of dependencies in the presence of virtual rules.
180 Ignore constraints on inherited position metavariables in a rule that
181 will be ignored.
182- Better support meta iterator and meta declarer tokens, and symid tokens.
183- Better indentation after added noindent.
17ba0788
C
184- Fixed length bug in the treatment of structures.
185- Allow inheriting declaration/field metavariables.
186- Don't drop spaces after parentheses in when no minus code present.
187 Thanks to Terry Wilson for reporting the problem.
188- Keep inherited metavariables in asttomember (preprocessing for matching)
189- allminus for types, to allow removing const, not just matching it
190- improved pretty printing when something is added before a closed brace
191- Allow matching on nameless structs. Thanks to Ron Minnich for reporting
192 the problem.
193- Pretty printing of const/volatile arrays in smpl code.
feec80c3
C
194- Don't allow just dropping an exp or type
195- Avoid removing #endif when surrounded by - code
d6ce1786
C
196- Print some important error messages even with the --very-quiet flag.
197- Fixed parallel building in the Makefiles
198- Fixed the compilation of the "pure bytecode" version. If you use the
199 bundled pycaml or ocaml-pcre, you'll need their stub libraries in
200 your LD_LIBRARY_PATH.
201- For get_constants, virtuals should be false, not true
202- C parsing of top-level declarers with initializations.
203- Remove constraints in predicates in match result, to avoid PCRE equality
204 problems
205- Enum assignment matching an enum value shouldn't cause a failure
8f657093 206
690d68d1
C
207* 0.2.5
208** Language:
3a314143
C
209- Make a very small attempt to parse C++ code, amounting to accepting
210 identifiers containing ::, tilde, and template invocations. Use the
211 option -c++. This is not likely to be very useful in practice.
b23ff9c7 212- Added metavariable metavariable type.
d3f655c6 213- Add disjunctions on identifiers in some contexts
f59c9fb7 214- Pretend that & indicates a pointer in -c++ mode
190f1acf
C
215- Support for new and delete
216- Allow arrays in smpl parameter declarations. Thanks to Jesper Louis
217 Andersen for pointing out the problem.
218- Field list metavariables
219- Add the ability to add __attributes__ (NB, no matching on attributes)
220- Slightly improved the error message for transformation on multiple
221 variable declaration. Thanks to Jonathan Nieder for pointing out the
222 problem.
690d68d1
C
223
224** Features:
225- support transformations on variables (only) in declarations that declare
226 multiple variables
3a314143
C
227- allow #endif XXX in C code
228- relax_include_path now applied to non local includes too, in which case
229 it tries to find a unique file with a suffix of the provided name.
230 this is useful for directories that are intended to be symbolic links.
231- support matching and removing #undef
232- support for iteration in ocaml, requires use of -no_show_diff
233- calls to likely and unlikely propagate test expression status to their
234 arguments
ca417fcf
C
235- reuse typedefs and macros from complete parsing when reparsing the
236 transformed code
190f1acf 237- better explanation when presenting glimpse tokens
d3f655c6 238- optimization for an if branch that is just { ... }
4dfbc1c2 239- spatch -control_flow_to_file file.c generates a file file.dot
190f1acf 240- include files with names ending in .cpp if -c++ option is given
6756e19d 241- removed use of the no longer supported sexplib function Conv.hashtbl_of_sexp
f537ebc4 242- add information about which Fedora packages are needed
690d68d1
C
243
244** Bugfix:
3a314143
C
245- improved parsing of expressions to allow ... to the right of operators in
246 more places
ca417fcf
C
247- Fix check_config for Python 2.7 on Fedora 14 (Reported-by: Michael Stefaniuc)
248- Check for ocamlfind in configure (Reported-by: Paul E. McKenney)
249- Postpone use of ocamlfind at runtime to report fewer errors
b23ff9c7 250- Add support for Python 2.4 binding with the provided pycaml library
190f1acf
C
251- Allow '@' in script code. Thanks to Laurent Reveillere for noticing the
252 problem.
253- Remove an optimization of x or true to true in asttoctl2 for the case
254 where x may make a modification, eg the case of -thing ?-thing
255- Allow adding comments before a function.
f537ebc4
C
256- Introduction of newlines in function arguments needs to take into account
257 that the code added by SmPL can include newlines. Thanks to Thomas
258 Gleixner for finding the problem.
690d68d1 259
413ffc02
C
260* 0.2.4
261** Language:
262- scripts now have names and can declare metavariables that are seen by
263 SmPL as identifier metavariables, see demos/{python,ocaml}tococci.cocci
264- declaration (match variable declarations) and field (match structure
265 field declarations) metavariables
c491d8ee 266- matching of array initializations and of enum declarations
413ffc02
C
267
268** Features:
269- compatability with Python 2.7. Thanks to Richard W.M. Jones for pointing
270 out the problem
271- python and ocaml string representations of parameter lists and expression
272 lists
273- try simpler patterns on glimpse failure
785a3008
C
274- graceful and immediate failure when a virtual rule is defined on the
275 command line, but not in the rule
c491d8ee
C
276- spatch returns -1 when a virtual rule is requested that is not supported
277- no transformation when using * with the option -no_show_diff
e6509c05
C
278- expanded +++ file name for match output
279- struct *^* and enum *^* metavariable types
5626f154
C
280- allow an assignment to match a variable initialization, even if multiple
281 variables are declared at the same time.
1eddfd50 282- add the option -recursive_includes
9bc82bae
C
283- added the option -use_idutils. The requires the previous use of the
284 script idutils_index.sh
413ffc02
C
285
286** Bugfix:
287- detect used after metavariables in simple statement metavariable match
785a3008
C
288- allow inheriting position variables over rules that make transformations
289 but depend on virtual rules that are not defined on the command line
290- treat top-level tokens in decl visitor. Thanks to Peter Tummeltshammer
291 for noticing a resulting problem.
c491d8ee 292- improve typing of the result of an assignment expression
e6509c05 293- eliminate some recursive calls in C code parsing to avoid stack overflows
c491d8ee
C
294- better pretty printing of #define when the whole line is removed
295- better pretty printing of asm code containing
296 "::[input]"r"(&coherence_data[i])"
297- allow pretty printing of C code with nameless bit fields
e6509c05
C
298- avoid adding an error message to standard output if ocamlfind is not
299 found
300- struct/union/enum-typed metavariables with a metavariable type name
5626f154
C
301- better management of whitespace between deleted lines. Thanks to
302 Andriy Gapon for noticing the problem.
303- improved parsing recovery for badly parsed struct/enum typedefs
304- drop expanded tokens in sgrep output. Thanks to Andriy Gapon for
305 noticing the problem.
306- constant strings have array type, not pointer type. Thanks to Vasiliy
307 Kulikov for noticing the problem.
1eddfd50
C
308- improve indentation when adding code after a function call with indented
309 arguments.
310- return type of sizeof converted to unsigned long. Thanks to Vasiliy
311 Kulikov for noticing the problem.
312- improve spacing when adding structure initializers. Thanks to Vasiliy
313 Kulikov for noticing the problem.
413ffc02 314
5636bb2c
C
315* 0.2.3
316** Language:
317- <= constraints relating an expression metavariable to one or more
318 inherited expression metavariables that it should be a subexpression of
319- the -inplace and -outplace options have been renamed -in_place and
320 -out_place. -in_place no longer makes a backup. A backup can be
321 requested using the option -backup_suffix, eg -backup_suffix .bk
322- identifiers can be constrained to be different from an inherited
323 identifier metavariable, or from a set containing both concrete
324 identifiers and inherited identifier metavariables.
174d1640 325- support for ocaml scripting
aba5c457 326- ast available in ocaml scripts
5636bb2c
C
327
328** Features:
329- drop inconsistent paths check when only one node was matched
330- allow #define id with no definition
331- attempt to add newlines in the generated code when function calls in the
332 smpl cause passing column 80
333- allow - in front of statement level nests, if everything inside the nest
334 is also -
90aeb998
C
335- 'configure' looks for some system libraries: menhirLib, sexplib, pycaml.
336 Not available libraries are replaced by a copy provided with the sources.
337- added static for a function goes just before what is specified in the
338 semantic patch, not before any comments etc.
339- Add a new option, -ignore_unknown_options, to ease the integration
340 of Coccinelle as a checker in a toolchain.
341- error in python code causes immediate abort of spatch
174d1640 342- use the same algorithm for collecting grep tokens as for collecting
90aeb998 343 glimpse tokens
174d1640
C
344- Add scripts/spatch.bash_completion for automatic completion of common
345 options under the bash shell.
aba5c457 346- Print rule name when a script rule crashes
88e71198
C
347- Allow the declaration of an expression list or parameter list
348 metavariable to specify the number of expressions or parameters,
349 respectively.
5636bb2c
C
350
351** Bugfix:
352- drop inconsistent paths check when only one node was matched
353- better take into account virtual rules when selecting glimpse tokens
354- print diff when only a comment is added
355- the type of the C code !x should be int regardless of the type of x
356- allow python code at the beginning of an included file
357- better adjustment of whitespace when deleting adjacent lines. Thanks to
358 Wolfram Sang for pointing out the problem.
359- allow metavariables to be inherited from included files
360- allow ? on goto
361- more graceful failure on finding a strange character in a macro parameter
362 list
363- support Parameter metavariables
364- add space after the last comma in an added portion of an argument list
90aeb998
C
365- SmPL nameless struct should only match a nameless struct, not a nameless
366 union. Thanks to Peter Tummeltshammer for pointing out the problem.
367- adjustments to storage don't modify inline as well
368- matching and transformation allowed on inline
369- allow removed field between two ... in structure initialization
370- allow removing an entire structure initialization
174d1640
C
371- manage labels within do while 0 macros
372- added space after : in printing a conditional expression. Thanks to Josh
373 Triplett for noticing the problem.
aba5c457
C
374- dropped trailing whitespace when code at the end of a line is deleted.
375 Thanks to Josh Triplett for noticing the problem.
88e71198
C
376- Fixed environment management when script rule uses cache. Thanks to
377 Bissyande for finding the problem.
378- when false matches if with no else
18b1275a
C
379- ensure { ... } with whencode checks to the end of the function. Thanks to
380 Rene Rydhof Hansen for finding the problem.
5636bb2c 381
c3e37e97
C
382* 0.2.2
383** Language:
384- Added ToTestExpression to iso language, see standard.iso for an
385 explanation
386- Added depends on to initialize and finalize script code
387
388** Features:
389- Update Emacs mode (cocci.el) to support 'virtual' rules and fix other
390 keywords sush as 'depends on', 'using', 'disable'
391- better treatment of != 0 in isos, communtativity for ==/!= for all
392 constants
aa721442 393- allow adding // comments and blank lines (even after cocci + code)
c3e37e97
C
394- Add support for multiple -I options
395
396** Bugfix:
397- correct interaction between virtual rules and included .cocci files
398- improvement in treatment of ! in isos, to avoid duplicating + code
aa721442 399- improvement in treatment of metavars as isos, to avoid duplicating + code
c3e37e97
C
400 between toplevel and variable instantiation
401- test expression of smpl conditional, etc no longer assumed to have type
402 int
403- correct + line numbers in the patch produced when using *
404- iso constant metavariable matches an identifier whose name is all capital
405 letters, eg NULL
406- allow / at the end of the name of a directory (-dir) or patch prefix
407 (-patch)
408- dropped space in + code after the binding of a type metavariable that is
409 a pointer type
410- better handling of . or .. in -dir name
411- allow keywords and metavariable names in identifier constraints (not sure
412 keywords is very useful, though)
aa721442
C
413- no lubtype on arguments of && and || in SmPL
414- allow unknown as type for array indices in SmPL
415- support matching of static annotation on functions that are both static
416 and inline
417- support ENOTDIR error in Common.lfile_exists, to allow for the case where
418 an include file is in a subdirectory that exists but is an ordinary file,
419 not a directory.
420- better management of unbound position variables that appear in
421 constraints
422- cause python parser to skip over // comments, hoping that // is not
423 meaningful inside python
424- require + on every line of a multiline comment
d6a55602
C
425- correct calculation of line numbers when there is script code
426- always annotate arguments of && || and ! as test expressions in C code.
c3e37e97 427
ae4735db
C
428* 0.2.1
429** Language:
430- Add virtual identifiers
431- Add coccilib.report and coccilib.trac Python modules
432- coccilib.org and coccilib.report are imported by default but not loaded
433 in the current scope.
434
435** Features:
436- Parse_error_msg now more helpful. New option -verbose_parsing for even
437 more information.
438- Improve Python import handling. They are imported once during script
439 initialization.
440
441** Bugfix:
442- correct treatment of depends on with || for virtual rules
443
7f004419
C
444* 0.2.0
445** Language:
446
447** Features:
448- Remove duplicated code in disjunctions
449- Better error message when grep finds nothing relevant. Thanks to Joe
450 Perches for the suggestion.
451- added -keep_comments option for the unparsing of the transformed code
452- Option "-version" now also gives information about built-in
453 Python binding support.
9f8e26f4
C
454- slightly faster environment manipulation in pathological cases
455- hack added to accept well-formed #define after function header
7f004419
C
456
457** Bugfix:
9f8e26f4 458- Proper consideration of #define macro arguments in checking for the use
7f004419 459 of metavariables and in computing the line numbers of complex terms
9f8e26f4
C
460- Better parsing of included .cocci files
461- Put included .cocci files in the right order
462- Bind position variables only once for #include
463- Fix bug in include_match that caused everything to halt when all matches
7f004419 464 were discarded
9f8e26f4
C
465- Merge unlikely/likely iso rules under a iso rule named unlikely
466- Some fixes to coccicheck rules, thanks to Andrew Lunn
467- Support groups in regular expression, thanks to Michael Stefaniuc
7f004419 468
951c7801
C
469* 0.1.11
470
471** Language:
472- Meta-identifier/function and constant could be filtered from SmPL by
473 regular expressions using the "~=" and "!~=" operators followed by
474 an OCaml regular expression (see man Str) in double quote.
7f004419
C
475- Virtual rules, which can be referenced in depends, and set and unset
476 using the command-line options -D
477- ++ for multiple additions
951c7801
C
478
479** Features:
951c7801
C
480- coccicheck: a framework to check a series of SmPL files on a project
481 see scripts/coccicheck for more information
482
483** Bugfix:
484- bind position variables to the correct starting position in the case of a
485 complex statement such as an if or while. Thanks to Derek Jones for
486 pointing out the problem.
487- checking for non mentioned case lines in switch should be unchecked.
488- space should be printed after sizeof when there are no parentheses around
489 the argument. Thanks to Daniel Walker for pointing out the problem.
490- avoid introducing sharing in propagating ! over () in treatment of isos
491- save_excursion has to handle and rethrow exceptions
492- eliminate unnecessary consideration of CVS strings. Thanks to David
493 Young for pointing out the problem.
494- completely new treatment of statement metavariables
951c7801
C
495- better type checking for macro definitions
496- drop regression testing in -parse_c
497
fc1ad971
C
498* 0.1.10
499
500** Language:
501- declarations allowed in switch, suggested by Derek M. Jones
502
503** Features:
504- use interval timer for timeouts. Thanks to Derek M. Jones for the
505 implementation.
506- more flexible env.sh, thanks to Derek Jones.
507- faster Python invocation
508- simplify unparsing in the sgrep case
509
510** Bugfix:
511- for glimpse there is no point to create a pattern containing a numeric
512 constant because glimpse doesn't index them
513- add spaces after commas in function calls and function headers
514- made python integration more like the ubuntu version
515 http://patches.ubuntu.com/by-release/extracted/debian/c/coccinelle/0.1.5dbs-2/01-system-pycaml
516 this fixes some memory management problems with None, True, and False
517- correct labels associated with a switch in the CFG so that a statement
518 metavariable can match a switch. Thanks to Derek Jones for pointing out
519 the problem.
520- keep switch pattern within switch body. Thanks to Derek Jones for
521 pointing out the problem.
522- Allow expanded tokens to be stored in metavariables, as long as they are
523 not removed. But this does currently allow them in + code, which will
524 produce the expansion. Thanks to Ali-Erdem Ozcan for pointing out the
525 problem.
526- improved adjustment of spacing when code removed at the beginning of a line
527
978fd7e5
C
528* 0.1.9
529
530** Language:
531- allow fresh identifiers to be declared using ## such that the value mixes
532 both strings and previously declared metavariables
533
534** Features:
535- better handling of expanded code containing ##. Now compute the
536 result.
537- more precise warning message for the "'\' outside define".
538 Thanks to Nicholas Mc Guire for pointing out the problem.
539- more precise warning message related to ifdefization.
540 Thanks to Derek Jones for pointing out the problem.
541- we don't create any more certain files in /tmp (they may be a cause
542 of security problems).
543 Thanks to Eugeniy Meshcheryakov for pointing out the problem.
544- More optimization for the case of just deleting a complete function.
545 Allows this to happen without tracing through all the control-flow
546 paths. Thanks to Francois Bissyande for pointing out the problem.
547- prevent code from being added to the beginning or end of a disjunction
548- more information about why a script is not applied when using -debug option
549- added -no_safe_expressions option
550- added -no_loops option. Ignores back edges derived from looping
551 constructs. This is unsafe, but perhaps useful for bug finding, as it can
552 be more efficient.
553- for semantic matches, allow "minus" on same code with multiple
554 environments
555- better error message for mismatch of parenthesis in column 0 with normal
556 parenthesis. Thanks to Derek Jones for pointing out the problem.
557- allow disjunctions on function return types. Thanks to Pierre Habouzit
558 for pointing this out.
559
560** Bugfix:
561- keep disjunction in the proper order for structure initialization fields
562- variables declared in different places should not seem to match each
563 other
564- drop complaints about label metavariables not being used
565- drop test information from the type of an expression when the expression
566 is bound to a metavariable
567- nests should not extend beyond the before and after code, even if the
568 before and after code matches the nest code
569- nests should extend into conditionals that end in error exit
570- take into account metavariables on "else". Thanks to Derek Jones for
571 pointing out the problem.
572- print single quotes on generated character constants
573- better typedef handling in the initialisation/affectation builtin
574 isomorphism, cf -test init_affect_typedef
575- support disjunction of types on variable declaration
002099fc
C
576- allow @ within strings in script code. ignore // comment lines in script
577 code.
578- don't drop + code placed after the transformed code
579- drop spaces produced by removing code before semicolons
580- adjusted spacing within generated code
581- less verbose -sp. Thanks to Derek Jones for pointing out the problem.
582- accept multiple type names in a SmPL typedef declaration.
978fd7e5 583
708f4980
C
584* 0.1.8
585
586** Language:
587
588** Features:
589- Metavariables now capture the cpp code contained within their definitions
590- When - fragments are separated by ... or nest boundaries in the semantic
591 patch, but end up matching adjacent source code, the comments, cpp code
592 and whitespace that are between them are not deleted.
593- better parsing of C: do expansion of macros only when needed when
594 have actually a parse error and also leverage the definition of macros
595 in the parsed file (or in a optional_standard.h file passed as a parameter).
596 This should reduce the need for many hardcoded definitions in standard.h
597- new semantics for the -macro_file option, by default now expand macros
598 only when necessary. To force use the -macro_file_builtins option instead.
599- a new -extract_macros command line action to help the parser. Works with
600 the -macro_file option. e.g.
601 $ ./spatch -extract_macros ~/linux > /tmp/alldefs.h
602 $ ./spatch -macro_file /tmp/alldefs.h -sp_file foo.cocci -dir ~/linux
603- removed -D macro_file option, not consistent with what -D usually means
604- reattempt to be more efficient for statement metavariables that are just
605 placeholders (ie, no modification, no reuse)
606- triples now returned from ctl in sorted order. The main key is the
607 state. On the other hand, the state order does not always agree with the
608 order of appearance in the code.
609- spatch is now less verbose on the things it does yet handle. Less confusing
610 for new users.
611- slightly better error report. Thanks to Derek Jones for the suggestion.
612- added the options -linux_spacing and -smpl_spacing. -linux_spacing
613 causes spatch to follow the spacing conventions of Linux, while
614 -smpl_spacing causes spatch to follow the spacing in the semantic patch.
615 -linux_spacing is the default.
616- more informative error reporting for the already tagged token case.
617 Thanks to Erik Hovland for the suggestion.
618
619** Bugfix:
620- better parsing of declare macro at toplevel and in structure.
621 cf -text xfield
622- allowing back typedef names for fieldname
623- better printing of else in generated code
624- slightly better type inference for binary operators.
625- clear out declarer names and iterator names between SmPL files (for
626 -testall)
627- better parsing and type checking of macro type aliases. Cf -test macro_int16.
628 Thanks to Li Yingtong for pointing out the problem.
629- make insert_virtual_positions tail rec, avoid stack overflow pb.
630 Thanks to Diego Liziero <diegoliz@gmail.com> for pointing out the
631 problem.
632- Better type inference for arithmetic binary operators
633 Thanks to Li Yingtong for pointing out the problem.
634- Better type inference for constants
635 Thanks to Li Yingtong for pointing out the problem.
636- move computing of adjacency information for semantic patches to after
637 application of isomorphisms, because isomorphisms can introduce "..."
638- compute adjacency information for negated ...
639- record with each transformation site the set of indices of the witness
640 trees that caused the transformation site to come about. Whitespace and
641 comments between remove tokens associated with disjoint witness trees is
642 not removed.
643- correct treatment of function pointer typed parameters in the SmPL ast0
644 visitor.
645- better parsing error message and error recovery when comments are not ended,
646 when some macros have a weird body, and when some switch have a weird
647 Body.
648 Thanks to Derek Jones for pointing out the problem.
649- better detection and passing of "dangerous" ifdefs, cf -test
650 double_switch.
651- dropped the separation of decls and body in Seq. This gives better
652 positioning of the bindings of metavariables shared between them.
653 Thanks to Erik Hovland for an example that shows the problem.
654
655** Internals:
656- supress warning in compiling ocamlsexp (warning caused by a new behavior
657 of cpp used internally in processing files in ocamlsexp/)
658
b1b2de81
C
659* 0.1.7
660
661** Language:
662- initialize and finalize script code, cf demos/initial_final.cocci
663
664** Features:
665- -iso_limit option to limit the depth of isomorphism application
666- with the dir option, the include path is implicitly set to the "include"
667 subdirectory of the specified directory, if the option -I is not used.
668- give a seed for the name of a fresh identifier
669- better handling of cpp "constructed" identifiers as in a##b, that in
670 the futur will make it easier to match over those idents.
671 cf tests/pb_parsing_macro.c. Thanks to Ali-Erdem Ozcan for pointing
672 out the problem. A new "parsing hack hint" is also available:
673 YACFE_IDENT_BUILDER, cf standard.h.
674
675** Bugfix:
676- drop excessive "optimization" in ctl generation for while and for loops
677- allow . as the name of the directory
678- for type inference for an assignment, take the type of the right-hand
679 side expression, not the type of the assigned variable
680- allow for with a declartion in the first header element, as in C++
681 (partial support)
682- allow for matching against variable declarations that include only
683 storage, eg static, but no type at all.
684- allow for matching against types that contain both short/long and int
685- allow the type metavariable in the SmPL code "unsigned T" to match a T
686 that is a type consisting of more than one word, eg long int.
687- -ifdef_to_if option made to process nested ifdefs
688 (partial support)
689
690** Internals:
691- improve and fix installation process (usable on BSD)
692- improve and fix testing process
693- apply patches from Eugeniy Meshcheryakov
694- reorganize the way we parse C identifiers, especially concatenated cpp
695 identifiers as in a##b. This may lead to some regressions as we may
696 not parse as much code as before.
697- removed popl/ and popl09/ and popl related stuff from official distrib.
698
0708f913 699* 0.1.6
113803cf 700
b1b2de81
C
701** Language:
702- the ability to add comments
703
113803cf 704** Features:
0708f913
C
705- grouping of generated rules with -hrule option
706- handling of special coccinelle comments
707 /* {{coccinelle:skip_start}} */ and
708 /* {{coccinelle:skip_end}} */
709 allowing to give more hints to the C parser.
710 Thanks to Flavien@lebarbe.net for the idea.
0708f913
C
711- the ability to print the values of more (but not all) kinds of
712 metavariables from python
713- new vim SmPL mode.
714 Thanks to Alexander Faroy.
715
716** Bugfix:
717- consider the ident tokens also in the 2 lines before the error line for the
718 10-most-problematic-parsing-errors diagnostic.
719- SmPL parser allows cast as the argument of a pointer
720- SmPL type checker allows enum as an array index
721- Better generation of fresh metavariables names in hrule
722- no more warnings about things that should be metavariables when there is
723 a disjunction in a function position
724- bugfix in parser, better error message.
725 Thanks to Ali-Erdem OZCAN <ali-erdem.ozcan@st.com> for the bug report.
726
727** Internals:
728
729* 0.1.5
730
731** Language:
113803cf
C
732- added initialiser metavariable
733- added sequences of designators in structures
0708f913
C
734
735** Features:
113803cf
C
736- improved printing of the C code corresponding to metavariables
737- improved printing when code (eg declarations) is removed at the beginning
738 of a block, and then is followed by a blank line
739- slightly less verbose error reporting in parsing_hacks
740
741** Bugfix:
742- fixed some problems with parsing SmPL code where a nest appears after a |
743- better treatment of { }, form in macros wrt unparse_c
744- less quiet for -parse_c
745- improve parsing heuristics regarding macro statement
746
747** Internals:
748
faf9a90c
C
749* 0.1.4
750
0708f913
C
751** Language:
752- long long added to SmPL
753
708f4980
C
754** Documentation:
755- add grammar reference and spatch command line options reference
756
faf9a90c
C
757** Features:
758- can match patterns of the form unsigned T or signed T, where T is a
759 metavariable
760- dropped the sizeof_parens isomorphism, which was made redundant by the
761 paren isomorphism
762- simple rule generation
faf9a90c
C
763
764** Bugfix:
765- trailing , ; and ) no longer left on a line by themselves
766- better treatment of error exit when the searched for code matches the
767 error exit condition.
768- fix incorrect treatment of parentheses in test_exps that could allow +
769 code to be added twice
770- don't ask whether iterator names and declarer names should be declared as
771 metavariables.
772- slightly better support for expression list metavariables.
773- short and long allowed for array index types in SmPL
774- more restrictions on type inference for pointer arithmetic in SmPL
775- allow isomorphisms to apply when + code is anywhere within all - terms
776- changed order of printing const and volatile
777- allow eg ... <... in plus code
778- better formatting of generated if/while/etc. code
779- better parse error reporting when the problem is at the end of the file
780
781** Internals:
782- isomorphisms don't apply under signed/unsigned, to prevent the creation
783 of things like unsigned signed int. Need a better solution for this.
784
91eba41f
C
785* 0.1.3
786
787** Features:
788- help in building the configuration macro file. The -parse_c action
789 now returns the 10 most frequent parsing errors. This give useful
790 hints to extend standard.h.
791
792** Bugfix:
793- positions no longer allowed on \(, \|, and \)
794- improved propagation of negation for isos in the presence of parens
795- convert Todos in flow graph construction to recoverable errors
796- fixed bug in treatment of when != true and when != false, to allow more
797 than one of them per ...
798- improve parsing of typedef of function pointer.
799- improve typing.
800- parsing and typing support for old style C function declaration.
801- consider position variables as modifications when optimizing the
802 translation into CTL of function definitions
803
804** Internals:
805
485bce71
C
806* 0.1.2
807
808** Bugfix:
809- better handling of ifdef on statements in control flow graph.
810- transform files even if they do not end in .c (thanks to Vegard Nossum)
811
812** Internals:
813- merge code of yacfe
814
1be43e12
C
815* 0.1.1
816
0708f913 817** Language:
485bce71 818 - support for initializer at toplevel, cf -test substruct
1be43e12 819
34e49164
C
820* 0.1
821
822** first public release of the source code:
823
0708f913 824** Language:
34e49164
C
825 - embeded python scripting
826 - position
827
0708f913
C
828** Features
829
34e49164
C
830* beta
831
832** first public release of the binary
833
834* alpha
835
836** Features
837 - lots of features ... look at coccinelle research papers and tutorials.