Thanks for the report. I have tried to improve the error message.
There is no short term solution for the semantic patch as written. But it is possible to reorganize the semantic patch in this case to make it work. The transformation needs to be just on the specific declared variable, and not on the complete declaration statement: @@ identifier x; type T; @@ T x - = x ; http://cocci.ekstranet.diku.dk/wiki/doku.php?id=more_that_one_variable_in_decl_error This only works since version 0.2.5-rc1. I think you have an earlier version, because when I added this feature, I also extended the error message. julia On Wed, 16 Mar 2011, Eugeniy Meshcheryakov wrote: > severity 618555 wishlist > forwarded 618555 co...@diku.dk > tags 618555 + upstream > thanks > > Hello, this bug was reported to Debian BTS. I hope coccinelle developers > have more info on it. > > 16 ÿÿÿÿÿÿÿÿÿÿÿÿÿÿ 2011 ÿÿ 05:20 -0500 Jonathan Nieder ÿÿÿÿÿÿÿÿÿÿÿÿÿÿ(-ÿÿÿÿ): > > Package: coccinelle > > Version: 0.2.4.deb-3 > > > > Hi, > > > > Given the uninitialized.cocci and fast-import.c as below[1], we > > find: > > > > $ spatch -sp_file uninitialized.cocci fast-import.c > > init_defs_builtins: /usr/share/coccinelle/standard.h > > HANDLING: fast-import.c > > Fatal error: exception Failure("More that one variable in decl. Have to > > split to transform.") > > > > I see two problems: > > > > 1. The message is unclear. I suppose the intent is something like > > > > fatal: cannot transform a line with multiple declarations in it > > It looks so to me, but I do not undertand the source code in that palce. > And I agree that the error message is not clear. > > > > > 2. The limitation is unfortunate. > > And this can be a future request for spatch. > > > > > Known problem? Do I understand correctly? > > > > Thanks for spatch. :) It's a great tool. > > Jonathan > > > > [1] > > -- 8< -- uninitialized.cocci -- 8< -- > > @@ > > identifier x; > > type T; > > @@ > > > > - T x = x; > > + T x; > > -- >8 -- snipsnip -- >8 -- > > -- 8< -- fast-import.c -- 8< -- > > static void parse_merge(void) > > { > > int *list = NULL, *n, *e = e; > > } > > -- >8 -- snipsnip -- >8 -- > > > > Regards, > Eugeniy Meshcheryakov >