[Cocci] Problem writing simple patch

2019-11-25 Thread David Frey
Hi, I'm trying to write a .cocci file to transform all calls to a function "f(ex)" to something like this: #ifdef USE_F f(ex) #else g(ex) #endif The function has this signature: bool f(int x); This is the patch that I tried to use: @@ expression ex; @@ +#ifdef USE_F f(ex) +#else +g(ex) +#endif

Re: [Cocci] Problem writing simple patch

2019-11-26 Thread David Frey
On 11/25/2019 1:10 PM, Julia Lawall wrote: > On Mon, 25 Nov 2019, David Frey wrote: > >> Hi, >> >> I'm trying to write a .cocci file to transform all calls to a function >> "f(ex)" to something like this: >> >> #ifdef USE_F >>