Re: [cocci] [RFC] Detecting unchecked return values (with SmPL)?
From: Julia Lawall
Date: Mon Nov 30 2026 - 10:49:26 EST
On Mon, 30 Nov 2026, Markus Elfring wrote:
> >> 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.
>
> Would you find the following SmPL script variant more appropriate for
> efficient source code searches?
>
>
> @display2@
> expression e;
> identifier i;
> @@
> (e = i(...)
> |
> *i(...)
> );
>
>
> Would you be looking for more advanced data constraints here?
*i(...);
seemed completely fine. There is no need to consider the other contexts
in which a funcion call can occur.
julia
>
> Regards,
> Markus
>