On 27.05.19 16:16, Markus Elfring wrote:
Am I missing something?

It depends on details.

Your initial transformation approach can be written also as follows.

@replacement@
identifier x;
@@
-int
+int*
  x; >

In which scopes would you like to add the asterisk for the usage of a pointer
data type?
I'm trying to replace a particular function call with a one-liner if the function is not defined, so I control the scope myself. In other words, in my original code "int x" is passed to "void f(int)" as a paramter, and I would like to apply the following transformations:
1) "x" has a type of "int *"
2) the new "int *x" gets passed to a function "void g(int *)" instead.


Do you expect that function parameters should be also modified here?

Regards,
Markus


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

Reply via email to