On Sun, 15 Feb 2015, SF Markus Elfring wrote:
> > /// Convert typdefed structs to structs
> >
> > @ rule1 @
> > identifier i;
> > type t;
> > @@
> > -typedef struct i {
> > +struct i {
> > ...
> > - }t;
> > + };
>
> How do you think about a bit more fine-tuning for your SmPL approach?
>
> ...
> }
> -t
> ;
>
> Is it sufficient to express the desired deletion at this place?
It is possible, but perhaps not necessary. It would depend on whether
there are any comments or attributes between the } and the ; that need to
be preserved. Currently they will be removed.
Another issue is that the typedef name might be (closer to) the one that
ou want to preserve. And i is not even necessary, I believe. You could
have another rule for the case where it is not present.
julia
_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci