Re: [Cocci] Addition of preprocessor statements with SmPL

2014-10-29 Thread SF Markus Elfring
I wanted to be able to re-run spatch on an already patched content. The use case is to add new function prototypes manually and run spatch to handle the associated #define automatically. Thanks for a bit more explanation. I imagine that you might need to specify more source code as adjustment

Re: [Cocci] Addition of preprocessor statements with SmPL

2014-10-29 Thread SF Markus Elfring
However, I fail to assemble those two patches in a single concise one. How do you think about the following approach? @Add_before_declaration@ identifier func; type t; @@ ( #define func BAR(func) t func(...); | +#define func BAR(func) t func(...); ) @Add_before_implementation@ identifier

Re: [Cocci] Addition of preprocessor statements with SmPL

2014-10-29 Thread SF Markus Elfring
@Add_before_implementation@ identifier func; type t; @@ ( #define func BAR(func) t func(...) { ... } | +#define func BAR(func) t func(...) { ... } ) This doesn't work. Interesting ... There is no kind of disjunction that includes a function definition in a branch. Was I

Re: [Cocci] Addition of preprocessor statements with SmPL

2014-10-29 Thread Julia Lawall
On Wed, 29 Oct 2014, Jean-Sébastien Pédron wrote: On 29.10.2014 11:26, Julia Lawall wrote: I wanted to be able to re-run spatch on an already patched content. The use case is to add new function prototypes manually and run spatch to handle the associated #define automatically. I

Re: [Cocci] Addition of preprocessor statements with SmPL

2014-10-29 Thread Jean-Sébastien Pédron
On 29.10.2014 12:07, Julia Lawall wrote: On Wed, 29 Oct 2014, Jean-Sébastien Pédron wrote: On 29.10.2014 11:26, Julia Lawall wrote: I wanted to be able to re-run spatch on an already patched content. The use case is to add new function prototypes manually and run spatch to handle the