On Tue, 13 Oct 2020, Markus Elfring wrote:

> > > Would you care a bit more for the clarification of the ordering for the 
> > > shown macro names?
> >
> > Why does the ordering matter, since they are all distinct?
>
> * It might look promising to reorder macro calls according to name criteria
>   and passed parameters.
>
> * But I imagine that the functionality of disjunctions by the semantic patch 
> language
>   can trigger further development considerations more in another direction.
>   
> https://github.com/coccinelle/coccinelle/blob/730dbb034559b3e549ec0b2973cd0400a3fa072f/docs/manual/cocci_syntax.tex#L1033
>
>   Later source code search patterns will only be checked in such SmPL 
> disjunctions
>   if previous parts did not match.
>   Thus often used code variants should probably be specified at the beginning
>   while special selections should be moved to the end.
>   The sorting of macro calls according to an estimated or actual usage 
> frequency
>   can influence the evaluation characteristics of affected SmPL code,
>   can't it?

No.  As I already pointed out, the different macros are disjoint.  The
order doens't matter.  Only one of the patterns will match any given loop.
If there are nested loops, the pattern will match multiple times.

julia
_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci

Reply via email to