> I didn't implement it, and I never use python.
I would struggle with OCaml script development more so far.
> Have a special rule for such functions and use position variables to
> prevent the rule that matches interesting parameter lists from matching
> functions that have satisfied this case:
Thanks for your SmPL pattern suggestion.
> @r@
> position p;
> identifier f;
> @@
>
> f@p(void} { ... }
>
> @goodfunctions@
> position p != r.p;
> parameter list[n] ps;
> identifier f;
> @@
>
> f@p(ps) { ... }
I would prefer to specify a meaningful constraint for the metavariable "ps"
somehow.
> Or you can just use your python code to see if ps is just the string
> "void".
I thought also in a similar direction. But I would like to be sure about the
passed data structures. I imagine that I would need to inspect the class
"coccilib.elems.TermList" if the corresponding documentation is unclear.
>
>> I am also interested a bit in run time optimisation. A passed list should be
>> sufficient for further computations. I do not really need a count in another
>> variable which was specified between square brackets of a SmPL rule.
>
> It is hard to imagine why converting all the elements of a list to strings
> as is done in the interface to python would be more efficient than just
> passing a single number.
I would like to try out two reports at least.
1. What is the maximum number of named function parameters in a source code
base?
I need only the value "n" (without the additional data from the related
metavariable).
2. Comparison for the incidence of unnamed function parameters to all of them
The parameter count could be determined from the list of parameter names
alone, couldn't it?
Regards,
Markus
_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci