[Cocci] convert if (x) stmt to if (x) {stmt}

Julia Lawall julia.lawall at lip6.fr
Fri May 18 19:12:18 CEST 2018



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

> >> I understood one suggestion in the way for a SmPL specification
> >> like the following.
> >>
> >> if (...)
> >> +{
> >>  S;
> >> +e;
> >> +}
> >
> > The rule has no goal of adding some unknown e;.
>
> How does this feedback fit to your wording “In each rule that contains S1,
> you first could replace the S1 by e; …”?

I didn't mean to write a semantic patch to remove S1 and add e;.  I meant
to put e; instead of S1 in the rule, producing the rule below.

julia

>
>
> > if (...)
> > + {
> >   e;
> > + }
> >   else S
> >
> > I don't see why one should consider whether e; should have been written in
> > a different way in making this transformation.
>
> It seems that you present another variant for a SmPL script.
>
> I assume that there are further constraints to consider for the discussed
> change pattern.
>
> Regards,
> Markus
>


More information about the Cocci mailing list