Hi, On Thu, May 19, 2011 at 10:38 AM, Francis Galiegue <[email protected]> wrote: > Hello, > > I'm just beginning with Coccinelle, and am able to do really simple > stuff, but I now stumble upon one which I cannot do. In fact, the > problem is, I don't read EBNF and am therefore not able to read the > grammar at all :/ > > Here is the simple problem I have: there is a vstralloc() function > whose list of arguments need to be NULL terminated. I want to detect > the case when it is NOT null terminated and append a NULL in this > case. What does the semantic patch look like in this case?
Is the following code working as you intent ? @@ expression E; @@ ( vstralloc(..., NULL) | * vstralloc(....,E) ) > > An EBNF hater, > -- > Francis Galiegue, [email protected] > "It seems obvious [...] that at least some 'business intelligence' > tools invest so much intelligence on the business side that they have > nothing left for generating SQL queries" (Stéphane Faroult, in "The > Art of SQL", ISBN 0-596-00894-5) > _______________________________________________ > Cocci mailing list > [email protected] > http://lists.diku.dk/mailman/listinfo/cocci > (Web access from inside DIKUs LAN only) > -- Nicolas Palix http://sardes.inrialpes.fr/~npalix/ _______________________________________________ Cocci mailing list [email protected] http://lists.diku.dk/mailman/listinfo/cocci (Web access from inside DIKUs LAN only)
