Coccinelle archive on lore.kernel.org
 help / color / Atom feed
From: "Christoph Böhmwalder" <christoph.boehmwalder@linbit.com>
To: cocci@systeme.lip6.fr
Subject: [Cocci] Remove entire multidecl
Date: Thu, 8 Aug 2019 12:51:22 +0200
Message-ID: <7e131616-a0c6-5b59-78b8-a92b569cda27@linbit.com> (raw)

So I've looked around in the demos/ and tests/ as well as the documentation,
but I can't seem to figure out what I'm doing wrong:

test.c
------
int x, y;


test.cocci
----------
@@
identifier x, y;
@@
- int x, y;


Should be pretty straightforward, but the rule does not match. Is there
another syntax to use here? In my real use case, I'm trying the same thing
within a function, and that doesn't match either.

Also, while playing around with it, I found this weird behaviour:

@@
identifier x, y;
@@
- int x;

Yields:

--- test.c
+++ /tmp/cocci-output-6916-8bc8e1-test.c
@@ -1 +1 @@
-int x, y;
+


Not exactly what I expected...

Thanks,
--
Christoph Böhmwalder
LINBIT | Keeping the Digital World Running
DRBD HA —  Disaster Recovery — Software defined Storage
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

             reply index

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-08 10:51 Christoph Böhmwalder [this message]
2019-08-08 11:01 ` Julia Lawall
2019-08-09  6:33   ` Markus Elfring

Reply instructions:

You may reply publically 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=7e131616-a0c6-5b59-78b8-a92b569cda27@linbit.com \
    --to=christoph.boehmwalder@linbit.com \
    --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

Coccinelle archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/cocci/0 cocci/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 cocci cocci/ https://lore.kernel.org/cocci \
		cocci@systeme.lip6.fr cocci@archiver.kernel.org
	public-inbox-index cocci


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/fr.lip6.systeme.cocci


AGPL code for this site: git clone https://public-inbox.org/ public-inbox