[RFC] Improved handling of member access operators with SmPL expression variables

From: Markus Elfring

Date: Sun Aug 30 2026 - 04:16:49 EST


Hello,

I pointed out that some data processing can be achieved by the means of
the semantic patch language.

SmPL script example:
@display2@
identifier an_item, a_field;
@@
(
*an_item.a_field
|
*an_item->a_field
)


Extend support for data processing with member identifications
2020-09-28
https://github.com/coccinelle/coccinelle/issues/226#issuecomment-699787269


Another SmPL script example:
@my_test@
expression hint;
@@
*hint->hint


Questionable test result (also according to the software combination “Coccinelle 1.3.2”):
Markus_Elfring@Sonne:…/Projekte/Coccinelle/Probe> spatch --parse-cocci show_expression_for_same_member_name.cocci

minus: parse error:
File "show_expression_for_same_member_name.cocci", line 4, column 7, charpos = 37
around = 'hint',
whole content = *hint->hint


How will development interests evolve to improve affected software components?
https://en.cppreference.com/c/language/operator_member_access#Member_access

Regards,
Markus