Hello,

  attached is a small example which
    injects a statement and a comment.

  It works well, but does'nt do exactly as wanted.

  I get :

+    j /* comments are overrated */
+    -= 3;

  The comment popped up within the expression instead
    of in front of it.
  no bug, but uggly.

Regards,
  Robert

int foo(int bar)
{
  int i, j;
  for (i = 5; --i>=0; ) {
    j+=54;
  }
  return j;
}

// (compile "spatch --sp-file ex2.cocci ex2.c")

@r0@
symbol j;
@@
  {
+   /* comments are overrated */   
+   j -= 3;
    j += 54;
    ...
  }
     

_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci

Reply via email to