cocci.inria.fr archive mirror
 help / color / mirror / Atom feed
* [Cocci] Matching against a declarer macro
@ 2020-03-27 15:42 Christoph Böhmwalder
  2020-03-27 15:47 ` Julia Lawall
  0 siblings, 1 reply; 9+ messages in thread
From: Christoph Böhmwalder @ 2020-03-27 15:42 UTC (permalink / raw)
  To: Coccinelle

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-03-29 11:50 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-27 15:42 [Cocci] Matching against a declarer macro Christoph Böhmwalder
2020-03-27 15:47 ` 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

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).