All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: Julia Lawall <julia.lawall@inria.fr>, cocci@inria.fr
Cc: Elia Pinto <gitter.spiros@gmail.com>
Subject: Re: [cocci] Fixing the adjustment of variable declarations
Date: Sun, 13 Nov 2022 13:26:29 +0100	[thread overview]
Message-ID: <2dd76fcc-0f76-e99b-80a1-2ade40e65380@web.de> (raw)
In-Reply-To: <b48551e5-3792-e563-469-57f2b17164@inria.fr>

> What is the problem with this semantic patch?

It tried to express a reduced transformation approach also according to
a clarification attempt by Elia Pinto.



> You didn't have the thoughfulness to provide a test case,

I published one yesterday.
https://lore.kernel.org/cocci/b73dc7c1-d5ad-dd23-f559-7b73939ed710@web.de/
https://sympa.inria.fr/sympa/arc/cocci/2022-11/msg00040.html


> but I tried one and it worked fine.
>
> int main () {
>   int x;
>   x = 'x';
> }

I can get a related test result.

Markus_Elfring@Sonne:…/Projekte/Coccinelle/Probe> spatch move_a_variable_declaration-20221112.cocci test_for_declarators2.c
…
@@ -1,5 +1,5 @@
 void my_test_for_one_declaration(void)
 {
- char o;
+ char
  o = 'x';
 }


Does it also mean that information from code deletions can generally be captured
for subsequent code additions?
https://gitlab.inria.fr/coccinelle/coccinelle/-/blob/768bd6eb0a2cbede8f1390009cc997ff57c339a4/docs/manual/cocci_syntax.tex#L1022

Why do I observe test results which are different in comparison to
the previously mentioned SmPL code variant “-T I;”?

Regards,
Markus

  reply	other threads:[~2022-11-13 12:26 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-09 11:42 [cocci] Possible bug in a semantic patch Elia Pinto
2022-11-09 11:49 ` Julia Lawall
2022-11-09 20:21 ` [cocci] Fixing the adjustment of variable declarations Markus Elfring
2022-11-11 19:10   ` [cocci] Reducing the scope for variables with SmPL Markus Elfring
2022-11-12  9:42   ` [cocci] Fixing the adjustment of variable declarations Markus Elfring
2022-11-12 10:38     ` Markus Elfring
2022-11-12 11:17       ` Julia Lawall
2022-11-12 11:45         ` Markus Elfring
2022-11-13 10:30     ` Markus Elfring
2022-11-13 10:36       ` Julia Lawall
2022-11-13 12:26         ` Markus Elfring [this message]
2022-11-13 14:10           ` Julia Lawall
2022-11-13 14:23             ` Markus Elfring
2022-11-13 14:28               ` Julia Lawall
2022-11-13 14:55                 ` Markus Elfring
2022-11-13 15:19                   ` Julia Lawall
2022-11-13 15:36                     ` 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=2dd76fcc-0f76-e99b-80a1-2ade40e65380@web.de \
    --to=markus.elfring@web.de \
    --cc=cocci@inria.fr \
    --cc=gitter.spiros@gmail.com \
    --cc=julia.lawall@inria.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.