cocci.inria.fr archive mirror
 help / color / mirror / Atom feed
From: "Christoph Böhmwalder" <christoph.boehmwalder@linbit.com>
To: Coccinelle <cocci@systeme.lip6.fr>
Subject: [Cocci] Matching against a declarer macro
Date: Fri, 27 Mar 2020 16:42:57 +0100	[thread overview]
Message-ID: <b86347f3-69d3-0801-c91f-87c3424e71dc@linbit.com> (raw)

Hi again,

I'm having a little trouble matching against this line of code:

RB_DECLARE_CALLBACKS_MAX(static, augment_callbacks, struct 
drbd_interval, rb, sector_t, end, NODE_END);

This is especially tricky because it contains a lot of macro magic.
I think the biggest problem is the first argument, which is the keyword 
"static". What do I use to match against this? expression? identifier? 
symbol?

Also, the "augment_callbacks" is not really an identifier either, it 
just gets used to generate the function names. But what is it? An 
expression?

@@
typedef sector_t;
declarer name RB_DECLARE_CALLBACKS_MAX;

identifier augment_callbacks;
identifier rb;
identifier end;
identifier NODE_END;
@@
-RB_DECLARE_CALLBACKS_MAX(static, augment_callbacks, struct 
drbd_interval, rb, sector_t, end, NODE_END);

Nothing I have tried has made it match yet.

Any ideas on how to solve this would be appreciated, 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	other threads:[~2020-03-27 15:43 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-27 15:42 Christoph Böhmwalder [this message]
2020-03-27 15:47 ` [Cocci] Matching against a declarer macro Julia Lawall
2020-03-27 16:02   ` Christoph Böhmwalder
2020-03-27 16:15     ` Julia Lawall
2020-03-29  8:48       ` Christoph Böhmwalder
2020-03-29  9:20         ` Julia Lawall
2020-03-29 11:16           ` Christoph Böhmwalder
2020-03-29 11:24             ` Julia Lawall
2020-03-29 11:50               ` Christoph Böhmwalder

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=b86347f3-69d3-0801-c91f-87c3424e71dc@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
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).