Re: [cocci] [RFC] Detecting unchecked return values (with SmPL)?

From: Markus Elfring

Date: Mon Nov 30 2026 - 08:25:53 EST


> > Macro and function calls for which a return value is not assigned to a variable
> > can be found also by a script (like the following) for the semantic patch language.
> >
> > @display@
> > identifier i;
> > statement s;
> > @@
> > (
> > *i(...);
> > &s
>
> &s seems totally unnecessary.

Can the code for the SmPL asterisk alone represent also a source code search
for a call where a variable assignment would be attempted?

Or:
Do you expect to specify the variable assignment exclusion in any other ways?

Regards,
Markus