263e735bf84845fe77b4769dec5b69bec86eb4c9
[bpt/coccinelle.git] / changes.txt
1 -*- org -*-
2
3 * 0.1.11
4
5 ** Language:
6 - Meta-identifier/function and constant could be filtered from SmPL by
7 regular expressions using the "~=" and "!~=" operators followed by
8 an OCaml regular expression (see man Str) in double quote.
9
10 ** Features:
11 - virtual rules, which can be referenced in depends, and set and unset
12 using the command-line options -D and -U
13 - coccicheck: a framework to check a series of SmPL files on a project
14 see scripts/coccicheck for more information
15
16 ** Bugfix:
17 - bind position variables to the correct starting position in the case of a
18 complex statement such as an if or while. Thanks to Derek Jones for
19 pointing out the problem.
20 - checking for non mentioned case lines in switch should be unchecked.
21 - space should be printed after sizeof when there are no parentheses around
22 the argument. Thanks to Daniel Walker for pointing out the problem.
23 - avoid introducing sharing in propagating ! over () in treatment of isos
24 - save_excursion has to handle and rethrow exceptions
25 - eliminate unnecessary consideration of CVS strings. Thanks to David
26 Young for pointing out the problem.
27 - completely new treatment of statement metavariables
28 - ++ for multiple additions
29 - better type checking for macro definitions
30 - drop regression testing in -parse_c
31
32 * 0.1.10
33
34 ** Language:
35 - declarations allowed in switch, suggested by Derek M. Jones
36
37 ** Features:
38 - use interval timer for timeouts. Thanks to Derek M. Jones for the
39 implementation.
40 - more flexible env.sh, thanks to Derek Jones.
41 - faster Python invocation
42 - simplify unparsing in the sgrep case
43
44 ** Bugfix:
45 - for glimpse there is no point to create a pattern containing a numeric
46 constant because glimpse doesn't index them
47 - add spaces after commas in function calls and function headers
48 - made python integration more like the ubuntu version
49 http://patches.ubuntu.com/by-release/extracted/debian/c/coccinelle/0.1.5dbs-2/01-system-pycaml
50 this fixes some memory management problems with None, True, and False
51 - correct labels associated with a switch in the CFG so that a statement
52 metavariable can match a switch. Thanks to Derek Jones for pointing out
53 the problem.
54 - keep switch pattern within switch body. Thanks to Derek Jones for
55 pointing out the problem.
56 - Allow expanded tokens to be stored in metavariables, as long as they are
57 not removed. But this does currently allow them in + code, which will
58 produce the expansion. Thanks to Ali-Erdem Ozcan for pointing out the
59 problem.
60 - improved adjustment of spacing when code removed at the beginning of a line
61
62 * 0.1.9
63
64 ** Language:
65 - allow fresh identifiers to be declared using ## such that the value mixes
66 both strings and previously declared metavariables
67
68 ** Features:
69 - better handling of expanded code containing ##. Now compute the
70 result.
71 - more precise warning message for the "'\' outside define".
72 Thanks to Nicholas Mc Guire for pointing out the problem.
73 - more precise warning message related to ifdefization.
74 Thanks to Derek Jones for pointing out the problem.
75 - we don't create any more certain files in /tmp (they may be a cause
76 of security problems).
77 Thanks to Eugeniy Meshcheryakov for pointing out the problem.
78 - More optimization for the case of just deleting a complete function.
79 Allows this to happen without tracing through all the control-flow
80 paths. Thanks to Francois Bissyande for pointing out the problem.
81 - prevent code from being added to the beginning or end of a disjunction
82 - more information about why a script is not applied when using -debug option
83 - added -no_safe_expressions option
84 - added -no_loops option. Ignores back edges derived from looping
85 constructs. This is unsafe, but perhaps useful for bug finding, as it can
86 be more efficient.
87 - for semantic matches, allow "minus" on same code with multiple
88 environments
89 - better error message for mismatch of parenthesis in column 0 with normal
90 parenthesis. Thanks to Derek Jones for pointing out the problem.
91 - allow disjunctions on function return types. Thanks to Pierre Habouzit
92 for pointing this out.
93
94 ** Bugfix:
95 - keep disjunction in the proper order for structure initialization fields
96 - variables declared in different places should not seem to match each
97 other
98 - drop complaints about label metavariables not being used
99 - drop test information from the type of an expression when the expression
100 is bound to a metavariable
101 - nests should not extend beyond the before and after code, even if the
102 before and after code matches the nest code
103 - nests should extend into conditionals that end in error exit
104 - take into account metavariables on "else". Thanks to Derek Jones for
105 pointing out the problem.
106 - print single quotes on generated character constants
107 - better typedef handling in the initialisation/affectation builtin
108 isomorphism, cf -test init_affect_typedef
109 - support disjunction of types on variable declaration
110 - allow @ within strings in script code. ignore // comment lines in script
111 code.
112 - don't drop + code placed after the transformed code
113 - drop spaces produced by removing code before semicolons
114 - adjusted spacing within generated code
115 - less verbose -sp. Thanks to Derek Jones for pointing out the problem.
116 - accept multiple type names in a SmPL typedef declaration.
117
118 * 0.1.8
119
120 ** Language:
121
122 ** Features:
123 - Metavariables now capture the cpp code contained within their definitions
124 - When - fragments are separated by ... or nest boundaries in the semantic
125 patch, but end up matching adjacent source code, the comments, cpp code
126 and whitespace that are between them are not deleted.
127 - better parsing of C: do expansion of macros only when needed when
128 have actually a parse error and also leverage the definition of macros
129 in the parsed file (or in a optional_standard.h file passed as a parameter).
130 This should reduce the need for many hardcoded definitions in standard.h
131 - new semantics for the -macro_file option, by default now expand macros
132 only when necessary. To force use the -macro_file_builtins option instead.
133 - a new -extract_macros command line action to help the parser. Works with
134 the -macro_file option. e.g.
135 $ ./spatch -extract_macros ~/linux > /tmp/alldefs.h
136 $ ./spatch -macro_file /tmp/alldefs.h -sp_file foo.cocci -dir ~/linux
137 - removed -D macro_file option, not consistent with what -D usually means
138 - reattempt to be more efficient for statement metavariables that are just
139 placeholders (ie, no modification, no reuse)
140 - triples now returned from ctl in sorted order. The main key is the
141 state. On the other hand, the state order does not always agree with the
142 order of appearance in the code.
143 - spatch is now less verbose on the things it does yet handle. Less confusing
144 for new users.
145 - slightly better error report. Thanks to Derek Jones for the suggestion.
146 - added the options -linux_spacing and -smpl_spacing. -linux_spacing
147 causes spatch to follow the spacing conventions of Linux, while
148 -smpl_spacing causes spatch to follow the spacing in the semantic patch.
149 -linux_spacing is the default.
150 - more informative error reporting for the already tagged token case.
151 Thanks to Erik Hovland for the suggestion.
152
153 ** Bugfix:
154 - better parsing of declare macro at toplevel and in structure.
155 cf -text xfield
156 - allowing back typedef names for fieldname
157 - better printing of else in generated code
158 - slightly better type inference for binary operators.
159 - clear out declarer names and iterator names between SmPL files (for
160 -testall)
161 - better parsing and type checking of macro type aliases. Cf -test macro_int16.
162 Thanks to Li Yingtong for pointing out the problem.
163 - make insert_virtual_positions tail rec, avoid stack overflow pb.
164 Thanks to Diego Liziero <diegoliz@gmail.com> for pointing out the
165 problem.
166 - Better type inference for arithmetic binary operators
167 Thanks to Li Yingtong for pointing out the problem.
168 - Better type inference for constants
169 Thanks to Li Yingtong for pointing out the problem.
170 - move computing of adjacency information for semantic patches to after
171 application of isomorphisms, because isomorphisms can introduce "..."
172 - compute adjacency information for negated ...
173 - record with each transformation site the set of indices of the witness
174 trees that caused the transformation site to come about. Whitespace and
175 comments between remove tokens associated with disjoint witness trees is
176 not removed.
177 - correct treatment of function pointer typed parameters in the SmPL ast0
178 visitor.
179 - better parsing error message and error recovery when comments are not ended,
180 when some macros have a weird body, and when some switch have a weird
181 Body.
182 Thanks to Derek Jones for pointing out the problem.
183 - better detection and passing of "dangerous" ifdefs, cf -test
184 double_switch.
185 - dropped the separation of decls and body in Seq. This gives better
186 positioning of the bindings of metavariables shared between them.
187 Thanks to Erik Hovland for an example that shows the problem.
188
189 ** Internals:
190 - supress warning in compiling ocamlsexp (warning caused by a new behavior
191 of cpp used internally in processing files in ocamlsexp/)
192
193 * 0.1.7
194
195 ** Language:
196 - initialize and finalize script code, cf demos/initial_final.cocci
197
198 ** Features:
199 - -iso_limit option to limit the depth of isomorphism application
200 - with the dir option, the include path is implicitly set to the "include"
201 subdirectory of the specified directory, if the option -I is not used.
202 - give a seed for the name of a fresh identifier
203 - better handling of cpp "constructed" identifiers as in a##b, that in
204 the futur will make it easier to match over those idents.
205 cf tests/pb_parsing_macro.c. Thanks to Ali-Erdem Ozcan for pointing
206 out the problem. A new "parsing hack hint" is also available:
207 YACFE_IDENT_BUILDER, cf standard.h.
208
209 ** Bugfix:
210 - drop excessive "optimization" in ctl generation for while and for loops
211 - allow . as the name of the directory
212 - for type inference for an assignment, take the type of the right-hand
213 side expression, not the type of the assigned variable
214 - allow for with a declartion in the first header element, as in C++
215 (partial support)
216 - allow for matching against variable declarations that include only
217 storage, eg static, but no type at all.
218 - allow for matching against types that contain both short/long and int
219 - allow the type metavariable in the SmPL code "unsigned T" to match a T
220 that is a type consisting of more than one word, eg long int.
221 - -ifdef_to_if option made to process nested ifdefs
222 (partial support)
223
224 ** Internals:
225 - improve and fix installation process (usable on BSD)
226 - improve and fix testing process
227 - apply patches from Eugeniy Meshcheryakov
228 - reorganize the way we parse C identifiers, especially concatenated cpp
229 identifiers as in a##b. This may lead to some regressions as we may
230 not parse as much code as before.
231 - removed popl/ and popl09/ and popl related stuff from official distrib.
232
233 * 0.1.6
234
235 ** Language:
236 - the ability to add comments
237
238 ** Features:
239 - grouping of generated rules with -hrule option
240 - handling of special coccinelle comments
241 /* {{coccinelle:skip_start}} */ and
242 /* {{coccinelle:skip_end}} */
243 allowing to give more hints to the C parser.
244 Thanks to Flavien@lebarbe.net for the idea.
245 - the ability to print the values of more (but not all) kinds of
246 metavariables from python
247 - new vim SmPL mode.
248 Thanks to Alexander Faroy.
249
250 ** Bugfix:
251 - consider the ident tokens also in the 2 lines before the error line for the
252 10-most-problematic-parsing-errors diagnostic.
253 - SmPL parser allows cast as the argument of a pointer
254 - SmPL type checker allows enum as an array index
255 - Better generation of fresh metavariables names in hrule
256 - no more warnings about things that should be metavariables when there is
257 a disjunction in a function position
258 - bugfix in parser, better error message.
259 Thanks to Ali-Erdem OZCAN <ali-erdem.ozcan@st.com> for the bug report.
260
261 ** Internals:
262
263 * 0.1.5
264
265 ** Language:
266 - added initialiser metavariable
267 - added sequences of designators in structures
268
269 ** Features:
270 - improved printing of the C code corresponding to metavariables
271 - improved printing when code (eg declarations) is removed at the beginning
272 of a block, and then is followed by a blank line
273 - slightly less verbose error reporting in parsing_hacks
274
275 ** Bugfix:
276 - fixed some problems with parsing SmPL code where a nest appears after a |
277 - better treatment of { }, form in macros wrt unparse_c
278 - less quiet for -parse_c
279 - improve parsing heuristics regarding macro statement
280
281 ** Internals:
282
283 * 0.1.4
284
285 ** Language:
286 - long long added to SmPL
287
288 ** Documentation:
289 - add grammar reference and spatch command line options reference
290
291 ** Features:
292 - can match patterns of the form unsigned T or signed T, where T is a
293 metavariable
294 - dropped the sizeof_parens isomorphism, which was made redundant by the
295 paren isomorphism
296 - simple rule generation
297
298 ** Bugfix:
299 - trailing , ; and ) no longer left on a line by themselves
300 - better treatment of error exit when the searched for code matches the
301 error exit condition.
302 - fix incorrect treatment of parentheses in test_exps that could allow +
303 code to be added twice
304 - don't ask whether iterator names and declarer names should be declared as
305 metavariables.
306 - slightly better support for expression list metavariables.
307 - short and long allowed for array index types in SmPL
308 - more restrictions on type inference for pointer arithmetic in SmPL
309 - allow isomorphisms to apply when + code is anywhere within all - terms
310 - changed order of printing const and volatile
311 - allow eg ... <... in plus code
312 - better formatting of generated if/while/etc. code
313 - better parse error reporting when the problem is at the end of the file
314
315 ** Internals:
316 - isomorphisms don't apply under signed/unsigned, to prevent the creation
317 of things like unsigned signed int. Need a better solution for this.
318
319
320 * 0.1.3
321
322 ** Features:
323 - help in building the configuration macro file. The -parse_c action
324 now returns the 10 most frequent parsing errors. This give useful
325 hints to extend standard.h.
326
327 ** Bugfix:
328 - positions no longer allowed on \(, \|, and \)
329 - improved propagation of negation for isos in the presence of parens
330 - convert Todos in flow graph construction to recoverable errors
331 - fixed bug in treatment of when != true and when != false, to allow more
332 than one of them per ...
333 - improve parsing of typedef of function pointer.
334 - improve typing.
335 - parsing and typing support for old style C function declaration.
336 - consider position variables as modifications when optimizing the
337 translation into CTL of function definitions
338
339 ** Internals:
340
341 * 0.1.2
342
343 ** Bugfix:
344 - better handling of ifdef on statements in control flow graph.
345 - transform files even if they do not end in .c (thanks to Vegard Nossum)
346
347 ** Internals:
348 - merge code of yacfe
349
350 * 0.1.1
351
352 ** Language:
353 - support for initializer at toplevel, cf -test substruct
354
355 * 0.1
356
357 ** first public release of the source code:
358
359 ** Language:
360 - embeded python scripting
361 - position
362
363 ** Features
364
365 * beta
366
367 ** first public release of the binary
368
369 * alpha
370
371 ** Features
372 - lots of features ... look at coccinelle research papers and tutorials.