Re: [cocci] Checking data structure member accesses after function return value assignments?

Julia Lawall <[email protected]> Mon, 19 Jan 2026 20:48:20 -0500 (EST)
Newsgroups fr.inria.cocci
Message-ID <[email protected]>

On Mon, 19 Jan 2026, Markus Elfring wrote:

> >> Another SmPL script example:
> …
> >> @display@
> >> expression action, pointer;
> >> identifier member;
> >> @@
> >> *pointer = action(...);
> >> *<+... (pointer)->member ...+>
> >>  ;

I think I was right in the first place.  This is as initialization of
pointer, followed by a sequence of statements containing
(pointer)->member, followed by an empty statement.  The third doesn't
exist in your code, so the pattern doesn't match.

julia

> >>
> >>
> >> Questionable test result:
> >> Markus_Elfring@Sonne:…/Projekte/Linux/next-analyses> time /usr/bin/spatch --no-loops …/Projekte/Coccinelle/janitor/show_questionable_statement_combination3.cocci drivers/regulator/fp9931.c
> >> [no diff output]
> >
> > OK, then I don't know.  It seems like it was possible to parse trhe
> > semantic patch.
> …
>
> Under which circumstances will corresponding software improvements become more likely?
>
> Regards,
> Markus
>