From: Markus Elfring <Markus.Elfring@web.de>
To: Coccinelle <cocci@systeme.lip6.fr>
Cc: "Gustavo A. R. Silva" <gustavoars@kernel.org>,
Kees Cook <keescook@chromium.org>
Subject: [Cocci] Checking the deletion of a multiplication operator with SmPL
Date: Sat, 29 Aug 2020 10:25:00 +0200 [thread overview]
Message-ID: <75644b75-443c-1da9-fd1b-35e2ce34cf47@web.de> (raw)
Hello,
The following small script variant for the semantic patch language gets accepted
according to the software combination “Coccinelle 1.0.8-00159-g730dbb03”.
@replacement@
identifier array, instance, size;
type T;
@@
(
-sizeof(T)
|
-sizeof(*instance->array)
)
*
+flex_array_size(instance, array,
instance->size
+ )
But I observe data processing difficulties if I would like to mark
the multiplication operator also for deletion (on a separate line).
elfring@Sonne:~/Projekte/Coccinelle/Probe> spatch --parse-cocci flex_array_size-test2-20200829.cocci
init_defs_builtins: /usr/local/bin/../lib/coccinelle/standard.h
File "flex_array_size-test2-20200829.cocci", line 10, column 1, charpos = 103
around = '*',
whole content = -*
Can such a transformation specification become supported?
Regards,
Markus
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci
next reply other threads:[~2020-08-29 9:03 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-29 8:25 Markus Elfring [this message]
2020-08-29 9:16 ` [Cocci] Checking the deletion of a multiplication operator with SmPL Julia Lawall
2020-08-29 11:02 ` [Cocci] Checking the application of a SmPL disjunction for a function call addition Markus Elfring
2020-08-29 11:11 ` Julia Lawall
2020-08-29 11:14 ` Markus Elfring
2020-08-29 11:45 ` Julia Lawall
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=75644b75-443c-1da9-fd1b-35e2ce34cf47@web.de \
--to=markus.elfring@web.de \
--cc=cocci@systeme.lip6.fr \
--cc=gustavoars@kernel.org \
--cc=keescook@chromium.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox