From: elfring@users.sourceforge.net (SF Markus Elfring)
To: cocci@systeme.lip6.fr
Subject: [Cocci] Conversion of some pointer arithmetic to array indexing style
Date: Sun, 17 Aug 2014 19:39:12 +0200 [thread overview]
Message-ID: <53F0E8C0.1080704@users.sourceforge.net> (raw)
In-Reply-To: <1408292542.17489.11.camel@joe-AO725>
> I don't think so as any type or combination of
> arithmetic operations would then need to be specified
> by the spatch input script.
I imagine that it will be occasionally useful to be more specific in
such semantic patterns.
@pointer_arithmetic@
identifier var, member, add;
int num1, num2;
@@
- *(var->member + add / num1 + num2)
+ var->member[add / num1 + num2]
> I think a precedence specification capability like first
> pointer match followed by longest arithmetic match would
> perhaps be a better generic facility.
>
I find it also nice when a semantic pattern could be written in a very
generic way. But I see that there are some technical challenges so that
false positives can be excluded.
Regards,
Markus
next prev parent reply other threads:[~2014-08-17 17:39 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-16 20:06 [Cocci] cocci: char* indexing style for linux Joe Perches
2014-08-16 20:59 ` Joe Perches
2014-08-17 10:11 ` Julia Lawall
2014-08-17 13:01 ` Joe Perches
2014-08-17 16:09 ` SF Markus Elfring
2014-08-17 16:22 ` Joe Perches
2014-08-17 17:39 ` SF Markus Elfring [this message]
2014-08-17 17:48 ` [Cocci] Conversion of some pointer arithmetic to array indexing style Julia Lawall
2014-08-17 17:42 ` [Cocci] cocci: char* indexing style for linux Julia Lawall
2014-08-18 8:37 ` Lars-Peter Clausen
2014-08-18 9:40 ` Julia Lawall
2014-08-18 11:31 ` SF Markus Elfring
2014-08-18 11:55 ` Julia Lawall
2014-08-18 9:49 ` Julia Lawall
2014-08-18 9:57 ` Lars-Peter Clausen
2014-08-18 10:33 ` Julia Lawall
2014-08-18 10:55 ` [Cocci] Clarification for array indexing style SF Markus Elfring
2014-08-18 10:59 ` Julia Lawall
2014-08-18 10:34 ` [Cocci] cocci: char* indexing style for linux Lars-Peter Clausen
2014-08-18 2:56 ` Julia Lawall
2014-08-18 8:08 ` [Cocci] Conversion of some pointer arithmetic to array indexing style SF Markus Elfring
2014-08-18 9:39 ` Julia Lawall
2014-08-18 10:35 ` SF Markus Elfring
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=53F0E8C0.1080704@users.sourceforge.net \
--to=elfring@users.sourceforge.net \
--cc=cocci@systeme.lip6.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.