Hi,
On 2026. 11. 18. 13:07, [email protected] wrote:
+@offsetof depends on patch@
+expression ptr, member;
+@@
+- offsetof(typeof(*(ptr)), member)
++ struct_offset(ptr, member)
+@offsetofend depends on patch@
+expression ptr, member;
+@@
+- offsetofend(typeof(*(ptr)), member)
++ struct_offsetofend(ptr, member)
[Severity: Low]
Do the inner parentheses in typeof(*(ptr)) prevent these rules from
matching unparenthesized typeof(*ptr) call sites?
In Coccinelle, the paren isomorphism expands E to (E) in one direction,
so matching typeof(*(ptr)) requires explicit parentheses around ptr in
the C source. Writing typeof(*ptr) matches both typeof(*ptr) and
typeof(*(ptr)).
It's actually the other way around. In fact, these parentheses were
suggested by Sashiko in the first place!
Bence
IMPORTANT NOTICE: The contents of this email and any attachments are
confidential and may also be privileged. If you are not the intended recipient,
please notify the sender immediately and do not disclose the contents to any
other person, use it for any purpose, or store or copy the information in any
medium. Thank you.