[Cocci] Problem when using a macro for mangling function names
Julia Lawall
julia at diku.dk
Fri Mar 20 21:28:52 CET 2009
> Indeed, I don't want the metavariable to be bound to 'foo' nor to METH(foo). I
> want it to be bound to the expanded value of METH(foo).
> For instance, say
> #define METH(x) prefix_##x
> I want the metavariable to be bound to prefix_foo when a METH(foo) is
> encountered. I want that because, it is legal that somewhere else in the code,
> there is direct reference to prefix_foo, and this should be detected by spatch
> to patch the code correctly. I have the feeling (as a lambda user) that what
> I want could be not so easy to implement if spatch doesn't really expand the
> macros. What do you think about that?
In the current version of Coccinelle, it won't work. Perhaps Yoann's
solution will make it possible though.
julia
More information about the Cocci
mailing list