From: "Christoph Böhmwalder" <christoph.boehmwalder@linbit.com>
To: Markus Elfring <Markus.Elfring@web.de>
Cc: cocci@systeme.lip6.fr
Subject: Re: [Cocci] Checking change scope for a data type replacement
Date: Mon, 27 May 2019 16:30:23 +0200 [thread overview]
Message-ID: <95a1255b-476b-e1b3-8a80-288dc9d3457f@linbit.com> (raw)
In-Reply-To: <9393a949-d787-adfd-3dab-4edc76e92b45@web.de>
On 27.05.19 16:16, Markus Elfring wrote:
>> Am I missing something?
>
> It depends on details.
>
> Your initial transformation approach can be written also as follows.
>
> @replacement@
> identifier x;
> @@
> -int
> +int*
> x; >
>
> In which scopes would you like to add the asterisk for the usage of a pointer
> data type?
I'm trying to replace a particular function call with a one-liner if the
function is not defined, so I control the scope myself. In other words,
in my original code "int x" is passed to "void f(int)" as a paramter,
and I would like to apply the following transformations:
1) "x" has a type of "int *"
2) the new "int *x" gets passed to a function "void g(int *)" instead.
>
> Do you expect that function parameters should be also modified here?
>
> Regards,
> Markus
>
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci
next prev parent reply other threads:[~2019-05-27 14:30 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-27 13:32 [Cocci] Are types re-evaluated between subsequent rules? Christoph Böhmwalder
2019-05-27 14:16 ` [Cocci] Checking change scope for a data type replacement Markus Elfring
2019-05-27 14:30 ` Christoph Böhmwalder [this message]
2019-05-27 15:00 ` Markus Elfring
2019-05-27 17:40 ` Markus Elfring
2019-05-27 17:46 ` Julia Lawall
2019-05-27 19:12 ` Markus Elfring
2019-05-27 14:28 ` [Cocci] Are types re-evaluated between subsequent rules? 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=95a1255b-476b-e1b3-8a80-288dc9d3457f@linbit.com \
--to=christoph.boehmwalder@linbit.com \
--cc=Markus.Elfring@web.de \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).