[Cocci] Addition of preprocessor statements with SmPL

Julia Lawall julia.lawall at lip6.fr
Wed Oct 29 11:23:08 CET 2014



On Wed, 29 Oct 2014, SF Markus Elfring wrote:

> >> @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 too optimistic that my suggestion with the specification of SmPL
> alternatives should also work?

You can see with spatch --parse-cocci what works and what does not.

julia


More information about the Cocci mailing list