Hi,
I tried to use coccinelle to add an empty element to compound literals
using spatch version 1.0.8 compiled with OCaml version 4.10.0.

Here is my script:
@@
identifier a;
identifier fld;
expression E;
@@
 struct A a = {
     ...,
     .fld = (struct B[]) {
         ...,
         { ..., E, ... },
+        {  }
     },
     ...,
 };

And I received the following error:
minus: parse error:
  File "add-end-of-list.cocci", line 8, column 21, charpos = 97
  around = '[',
  whole content =      .fld = (struct B[]) {

Am I missing something?

Thanks,
Peng
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

Reply via email to