On Mon, 21 Sep 2020, Markus Elfring wrote:

> Hello,
>
> I have tried another tiny script variant out for the semantic patch language
> (according to the software combination “Coccinelle 1.0.8-00177-g28737419”).
>
> @find@
> identifier i;
> type t;
> @@
>  t i(...)
>  { ... }
>
> @find_static@
> identifier find.i;
> type find.t;
> @@
>  static t i(...)
>  { ... }
>
> @display depends on !find_static@
> identifier find.i;
> type find.t;
> @@
> *t i(...)
>  { ... }
>
>
> This source code analysis approach is generally working in the way
> it is designed.
> Can the same data processing results be achieved also with a single SmPL rule?

There is an isomorphism related to static.  Maybe optional_qualifier.
That is, in the third rule, if you remove the depends on and add disable
optional_qualifier, then it would not match a static function.

julia
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

Reply via email to