On Fri, 19 Jul 2019, Christoph Böhmwalder wrote: > Hi, > > I believe I've stumbled upon a bug here: > > repro.cocci > ------------------- > @@ > @@ > - COCCI_REPLACE_THIS(); > + int x __attribute__((some_attr)); > > @@ > @@ > - foo(); > + f(g()); > > > repro.c > ------------------- > int main() > { > COCCI_REPLACE_THIS(); > } > > > spatch --sp-file repro.cocci repro.c > ------------------- > init_defs_builtins: /usr/lib/coccinelle/standard.h > HANDLING: repro.c > diff = > --- repro.c > +++ /tmp/cocci-output-4924-2aa580-repro.c > @@ -1,4 +1,9 @@ > int main() > { > - COCCI_REPLACE_THIS(); > + int x__attribute__((some_attr)); > + > +@@ > +@@ > +- foo(); > ++ f(g()); > } > > > Apparently this requires the __attribute__ in the first rule *and* the function > call as an argument in the second rule, if I remove either of those the patch > works as intended. What version of Coccinelle of do you have? I get the correct output on this example: diff = --- attr.c +++ /tmp/cocci-output-153931-8de7ba-attr.c @@ -1,4 +1,4 @@ int main() { - COCCI_REPLACE_THIS(); + int x__attribute__((some_attr)); } julia > > Regards, > Christoph > > -- > 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 >