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

Markus Elfring
2025-07-01T14:06:28Z

>> Would you like to suggest the exclusion of a single return statement
>> by a more appropriate source code search approach?
> Requiring the presence of a declaration already excludes the case of a
> single return.

Variable declarations (and definition) can also be specified after
a return statement, can't they?

> If you want to exclude a single return after a
> declaration, then the return should be put in the disjunctions with the
> *s. The *sl will again never match anything, because it's not coming
> immediately after a {}. It comes immediately after a declaration.

Is the handling of curly brackets (for compound statements) still unclear
so far?

Regards,
Markus