> I like that COPY_ARRAY and MOVE_ARRAY are handled in the same rule, > as they share the same parameters and do the same -- except that > the latter handles overlaps, while the former may be a bit faster. > > And I like that it's short. Thanks for such positive feedback after our growing discussion. > I don't like that ALLOC_ARRAY is handled in the same rule, as it is > quite different from the other two macros. This case distinction can share a few metavariables with the other transformation approach, can't it? > Coccinelle needs significantly longer to apply the new version. This can happen because of a more complete source code search pattern, can't it? The data processing can benefit from parallelisation (if desired.) https://github.com/coccinelle/coccinelle/blob/66a1118e04a6aaf1acdae89623313c8e05158a8d/docs/manual/spatch_options.tex#L745 > Here are times for master: The SmPL script execution times can be analysed also directly with the help of the Coccinelle software by profiling functionality. https://github.com/coccinelle/coccinelle/blob/66a1118e04a6aaf1acdae89623313c8e05158a8d/docs/manual/spatch_options.tex#L736 > ... and here with the patch applied: > > Benchmark #1: make contrib/coccinelle/array.cocci.patch > Time (mean ± σ): 43.420 s ± 0.490 s [User: 43.087 s, System: 0.273 s] I got an other distribution of run times on my test system. > The current version checks if source and destination are of the same type, > and whether the sizeof operand is either said type or an element of source > or destination. The specification of metavariables for pointer types has got some consequences. > The new one does not. I suggest to use a search for (pointer) expressions instead. This approach can trigger other consequences then. > So I don't see claim 4 ("Increase the precision") fulfilled, I tried to express an adjustment on the change granularity by the plus and minus characters at the beginning of the lines in the semantic patch. The SmPL disjunctions provide also more common functionality now. > quite the opposite rather. The search for compatible pointers can become even more challenging. > I think an automatic transformation should only be generated if it is safe. Different expectations can occur around safety and change convenience. Would you eventually work with SmPL script variants in parallel according to different confidence settings? > It's hard to spot a weird case in a generated patch amid ten > well-behaving ones. I can follow also this development concern to some degree. Regards, Markus