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

Markus Elfring <[email protected]> Tue, 20 Jan 2026 14:45:35 +0100
Newsgroups fr.inria.cocci
Message-ID <[email protected]>
>> Can such an SmPL code variant prevent the interpretation as an “empty statement”?
> 
> Yes, because as already explained the () forces the <+... ...+> to be considered to be an expression.

Thanks for your clarification.


>>> This should you give what you seemed to want, with pointer->member in the
>>> immediately following statement only.
>>
>> Another SmPL script variant can be tried out:
>> @refined_display@
>> expression action;
>> expression * pointer;
>> identifier member;
>> @@
>> *pointer = action(...);
>> (
>> <+...
>> *pointer->member
>> ...+>
>> );

How will the software run characteristics evolve further
if it would be dared to apply such a generic source code search pattern
on more files?

Regards,
Markus