public inbox for cocci@systeme.lip6.fr
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: cocci@inria.fr
Subject: [cocci] Moving string literals with SmPL?
Date: Mon, 10 Nov 2025 16:10:16 +0100	[thread overview]
Message-ID: <a2551ccb-edd1-403c-bcd6-3f9cd5381bcb@web.de> (raw)

Hello,

I would appreciate if another source code transformation can be achieved
also by the means of the semantic patch language.
Thus I tried the following SmPL script variant out.

// See also:
// crypto_rng_show()
// https://elixir.bootlin.com/linux/v6.18-rc4/source/crypto/rng.c#L82-L86
@adjustment@
constant char[] last_literal, literal;
expression context;
@@
-seq_printf(context, literal);
 seq_printf(context,
+           literal
            last_literal,
            ...);


Unfortunately, I am wondering about the following information.

Questionable test result (according to the software combination “Coccinelle 1.3.0”):
Markus_Elfring@Sonne:…/Projekte/Coccinelle/janitor> /usr/bin/spatch --parse-cocci combine_selected_seq_printf_calls.cocci
…
plus: parse error: 
  File "combine_selected_seq_printf_calls.cocci", line 11, column 12, charpos = 267
  around = 'last_literal',
  whole content =             last_literal,


Under which circumstances will such data processing become better supported?
http://www.en.cppreference.com/w/c/language/string_literal.html

Regards,
Markus

             reply	other threads:[~2025-11-10 15:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-10 15:10 Markus Elfring [this message]
2025-11-10 18:24 ` [cocci] Moving string literals with SmPL? Julia Lawall
2025-11-11  7:05   ` Markus Elfring
2025-11-11 11:53     ` Julia Lawall
2025-11-11  8:30 ` 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=a2551ccb-edd1-403c-bcd6-3f9cd5381bcb@web.de \
    --to=markus.elfring@web.de \
    --cc=cocci@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox