On Tue, 4 Aug 2015, Petr Malát wrote:

> Hi Julia,
> thanks for the answer
> > Coccinelle expects that each element in a parameter list will have the
> > form type identifier.  In the case of name, you just have an identifier.
> > I don't really see a solution.
> I though similar operations are generally possible, if all required macros
> are known.

No.  Macros are somewhat taken into account when parsing the C code.  But
here you are talking about the SmPL (pattern) code, which is different.

> Anyway, I've worked it around by using something like
>
> @@
> type T1;
> identifier i1, name;
> typedef DELME;
> @@
> - long name(T1 i1) {
> + COMPAT_SYSCALL_DEFINE1(DELME name, T1 DELME_TOO, DELME i1) {
>   ...
>   }
>
> and then fixing the generated patch with sed.

Yeah, not ideal, but perhaps easier than making all the changes by hand.

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

Reply via email to