Re: [cocci] Searching function implementations with more than a single return?

Markus Elfring
2025-07-01T13:51:14Z

>>> Another SmPL script example:
>> for further development considerations?
>>
>> @display@
>> identifier i;
>> statement s;
>> statement list sl;
>> type t;
>> @@
>> (return ...;
>> |t i;
>> (
>> <+...
>> *s
>> ...+>
>> |
>> *sl
>> )
>> )
>
> This one makes no sense, because return and t i; can't match the same
> thing. So the disjunction has no impact.
Would you like to suggest the exclusion of a single return statement
by a more appropriate source code search approach?

Regards,
Markus