On 08/26/2011 11:52 AM, Julia Lawall wrote:
>>> OK.  I don't know if it will match, though. The matching process may look 
>>> at the actual string.
>> It just works(TM). Brilliant as it is a very trivial solution.
> 
> OK, it seems that the matching process only looks at the struct or union 
> tag.
> 
>> I know (*), that's why I have shot for the lexer patch as that is the
>> time when macro transformation should happen. Using an example like this
>> command line switch "-C_define interface=struct" would have probably
>> been a better idea but it doesn't shows that I really want to do the
>> macro substitution and have that in the resulting diff.
> 
> It's a successful solution to the immediate problem, but I don't see how 
> it generalizes.
If it wouldn't have worked out I would have dusted off one of my
pre-coccinelle perl scripts that jumps over comments and C strings and
done it that way. For me the generalized solution is to use the tool
that gets the job done with the least amount of work; I have a "lazy"
sysadmin background after all ;)

Does coccinelle need a generalized macro substitution solution? I can
come up only with only two halfway decent reasons (which I don't really
need myself for Wine):
- To fix macro usage in C code that doesn't looks like C.
- Convenience for the user to not write full valid SmPL replacement rules.

bye
        michael
_______________________________________________
Cocci mailing list
[email protected]
http://lists.diku.dk/mailman/listinfo/cocci
(Web access from inside DIKUs LAN only)

Reply via email to