Re: [4/5] Coccinelle: put_device: Extend when constraints for two SmPL ellipses
From: Julia Lawall
Date: Tue May 14 2019 - 02:54:35 EST
On Tue, 14 May 2019, Markus Elfring wrote:
> >> A SmPL ellipsis was specified for a search approach so that additional
> >> source code would be tolerated between an assignment to a local variable
> >> and the corresponding null pointer check.
> >> But such code should be restricted.
> >> * The local variable must not be reassigned there.
> >> * It must also not be forwarded to an other assignment target.
> >> Take additional casts for these code exclusion specifications into account
> >> together with optional parentheses.
> > NACK.
> Can you agree to any information which I presented in the commit message?
> > You don't need so many type metavariables.
> It seems that the Coccinelle software can cope also with my SmPL code addition.
> You might feel uncomfortable with the suggested changes for a while.
It's ugly. Much more ugly than msg =
> > Type metavariables in the same ... can be the same.
> Such information is good to know for the proper usage of specifications
> after a SmPL ellipsis.
> * Can it become required to identify involved source code placeholders
> by extra metavariables?
I don't understand the question.
> * Would you like to clarify the probability any more how often the shown
> type casts will be identical?
No idea about this one either.
Basically, if you have T && T, the two T's have to be the same, and T is
not pure. If you have T || T, then only one will be matched and T remains
pure. If you have T on two separate ...s then you are in the && case. If
you have T in two branches of a disjunction or in two whens on the same
... you are in the || case. Just as you can use the variable e1 over and
over on the same when, you can use the same T.