Hi there, I was wondering how to handle this situation in SmPL. I have a
codebase that defines a couple macros for use within for loops, mostly used to
iterate lists, like this:

for (LIST_ELEMENTS(…)) {
   /* blah blah */
}

I’m having trouble figuring out how to write a rule that matches these for
statements without resorting to doing preprocessor expansion before I run
spatch. The semantics I’m trying to achieve are:

@@
…
@@

for (LIST_ELEMENTS(…)) {
   /* stuff I want to match is here */
}

Could I get some help? Barring that, I’d also take a link to the appropriate
documentation, if I’ve missed it. Thanks in advance.

Quentin
_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci

Reply via email to