cocci.inria.fr archive mirror
 help / color / mirror / Atom feed
* [Cocci] Matching more than one declaration?
@ 2019-05-02 21:04 Michael Stefaniuc
  2019-05-03  7:17 ` Julia Lawall
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Stefaniuc @ 2019-05-02 21:04 UTC (permalink / raw)
  To: Coccinelle

Hello,

it seems that more than one declaration cannot be matched in one rule:

@@
identifier i, f;
@@
- int i;
- int f;

That won't match

void foo(void)
{
    int i;
    float f;
}


Is there a way to do that?
In my specific case I need to replace 3 declarations with a single
declarer. I can use 3 separate rules but the first rule will produce
false positives if the other two declarations aren't there.


thanks
bye
      michael
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

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

end of thread, other threads:[~2019-05-03 20:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-02 21:04 [Cocci] Matching more than one declaration? Michael Stefaniuc
2019-05-03  7:17 ` Julia Lawall
2019-05-03  8:03   ` Michael Stefaniuc
2019-05-03 20:39     ` Julia Lawall
2019-05-03 20:44       ` Michael Stefaniuc

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