[Cocci] Matching function pointer typedef

Julia Lawall julia.lawall at lip6.fr
Fri May 18 18:53:39 CEST 2018



On Fri, 18 May 2018, SF Markus Elfring wrote:

> >> I am trying to modify an function pointer typedef something like:
> >>
> >> @@
> >> @@
> >> - typedef void (*toto_t)(int a, int b);
> >> + typedef void (*toto_t)(int a, int b, int c);
> >
> > This now works.
>
> Thanks for another software improvement.
> https://github.com/coccinelle/coccinelle/commit/80dcf751e411f1421fdcdb7119a95e50b841609c
>
>
> > Currently, you need to remove the whole typedef and add it back,
>
> I find this information inappropriate because such a source code replacement
> was attempted.

It was attempted before the change was made.

julia

>
>
> > not just add the third argument as Håkon suggested.
>
> It can be clearer to limit changes precisely while it can be also occasionally nice
> to extend the adjustment a bit so that the affected source code will be
> hopefully reformatted by the Coccinelle software in a desired way.
> https://github.com/coccinelle/coccinelle/issues/37
>
> Regards,
> Markus
>


More information about the Cocci mailing list