Skip to contentSkip to conversation

return value Coccinelle exercise

DISCUSSION Julia Lawall 1 participant 1 message Mar 14, 2019

lore
Share & tools
lore
#0 lore raw

Hello,

In many cases it turns out that the return value Coccinelle semantic patch reports on things that in practice people would rather have left as they are. One option is to choose carefully what you decide to send to the mailing list. Ask yourself is the code better before or after, or does the change raise some other opportunity for improvement. Another option is to make the pattern in the semantic patch more restrictive, so that it returns only results that are more likely to be of interest.

For example instead of the pattern ret = e you could match ret = e(...), thus ensuring that the pattern only matches when the ret variable is assigned the result of a function call. This may cause you to miss some change opportuities, but will give fewer results, so may make it easier to find the promising ones.

julia