All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: Luis Chamberlain <mcgrof@kernel.org>
Cc: Eric Wheeler <cocci@lists.ewheeler.net>, cocci@inria.fr
Subject: Re: [cocci] Checking the construction of a fresh identifier
Date: Sun, 13 Mar 2022 19:30:17 +0100	[thread overview]
Message-ID: <4ab15cf7-5c74-961f-e50b-ee84d7e55b6a@web.de> (raw)
In-Reply-To: <Yi4ce+2k03795Rut@bombadil.infradead.org>

…
> @initialize:python@
> @@
>
> def make_my_fresh_expression(s1, s2):
> return '"' + s1.strip('"') + "/" + s2.strip('"') + '"'
>
> @r3 depends on c1 && c2 && c3@
> expression c1.E1;
> identifier c1.sysctls;
> expression c2.E2;
> identifier c2.base;
> identifier c3.header;
> fresh identifier E3 = script:python(E2, E1) { make_my_fresh_expression(E2, E1) };
> @@
>
> header =
> -register_sysctl_table(base);
> +register_sysctl(E3, sysctls);


I find it questionable that an “identifier” for the C programming language may contain
quotation characters and a slash.

Do you depend on any special software behaviour here?
https://gitlab.inria.fr/coccinelle/coccinelle/-/blob/20fdb67f4b20a242f222337e13091115884cf6bb/docs/manual/cocci_syntax.tex#L280
https://github.com/coccinelle/coccinelle/blob/ae337fce1512ff15aabc3ad5b6d2e537f97ab62a/docs/manual/cocci_syntax.tex#L280


Regards,
Markus


  parent reply	other threads:[~2022-03-13 18:30 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-13  0:53 [cocci] Can Coccinell concatinate or append to existing string literals? Eric Wheeler
2022-03-13  7:05 ` Julia Lawall
2022-03-13  9:45 ` [cocci] Can Coccinelle concatenate " Markus Elfring
2022-03-13  9:57   ` Julia Lawall
2022-03-13 13:00     ` Markus Elfring
2022-03-13 16:31 ` [cocci] Can Coccinell concatinate " Luis Chamberlain
2022-03-13 17:24   ` [cocci] Can Coccinelle concatenate " Markus Elfring
2022-03-13 17:33     ` Julia Lawall
2022-03-13 18:30   ` Markus Elfring [this message]
2022-03-15  2:40   ` [cocci] Can Coccinell concatinate " Eric Wheeler

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=4ab15cf7-5c74-961f-e50b-ee84d7e55b6a@web.de \
    --to=markus.elfring@web.de \
    --cc=cocci@inria.fr \
    --cc=cocci@lists.ewheeler.net \
    --cc=mcgrof@kernel.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 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.