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